0

More a back end programmer, but I'm implementing a design, and I just wanted to see what the most efficient way of implementing a border box would be.

Here is an example of the box -

border box

The idea is that the blue tab will contain the header text for the section.

Ideally I'd like to use just HTML and CSS, but I realise I may need to use the tab as an image because of it's shape. These boxes can be numerous sizes depending on the content.

I could do the blue border no problem using

 -webkit-border-radius: 10px; -moz-border-radius: 10px;

or similar, it's mainly the tab that poses the issue for me. Has anyone done anything similar that can offer advice?

1
  • What browsers do you need to support? Commented Sep 28, 2012 at 9:24

2 Answers 2

1

Start here and modify as you need, should work for what you're after.

Sign up to request clarification or add additional context in comments.

Comments

1
.tab-header {
  background: blue;
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
  padding-bottom: 10px; /* we extend the header by 10px to the bottom */
}

.tab-body {
  border: 1px solid blue;
  background: white; /* set a solid background */
  margin-top: -10px; /* move the body 10px up, so it covers the
                        10px padding from above */
}

You must prefix the border-radius stuff accordingly, but apart from that this should work in any recent browser.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.