This is a discussion on "rounded boxes with CSS" within the Web Page Design section. This forum, and the thread "rounded boxes with CSS are both part of the Design Your Website category.
|
|
|
|
|
![]() |
||
rounded boxes with CSS
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
rounded boxes with CSS
OK, need a bit of help here. I am trying to make this box with CSS. You'll notice there is also a drop shadow. My thought was to take a horizontal slice and tile that for the background, then put the top and bottom 'caps' on it
I've tried alot of combos, searched the web, can't really find anything. Alot of info making rounded corners without shadows.... Too much more this, I'm about to say f' this and throw the GD thing in a 3 row table! Any ideas on the best way to build this box in CSS? Thanks! |
|
|
|
|||
|
Re: rounded boxes with CSS
Slice it into three rows.
Top will have the top horizontal part of the box. Place it in a div called #top. Set the width and height to this div and no need to repeat. Middle slice just needs to be a slice of about 3px high by the width. Place this in a div called #middle as the background image. Repeat-y and set the width. Now this is where you will put the content. This div will expand down with more content. Slice the bottom portion of the box and place it in a div called #bottom. Set the width and height to this div- no need to repeat. This can all be nested inside another div if it helps you to place it correctly on the page. This box is famous for having spaces so make sure to add this to your css:
|
|
|||
|
Re: rounded boxes with CSS
OK, but this was my first approach, and it didn't seem to work. hmm.. I put the three in a div container that was set to float:left (there's another box like this next to it)
Oh, sorry to offend anyone here, but I have a certain amount of hours to get this thing built, so I just through it in a 3 row table wrapped in a div. Worked, and took me 5 minutes... Maybe I'll revisted this section when I have some extra time.. |
|
|||
|
Re: rounded boxes with CSS
Well, I tried it on a test page, seems to work, with the exception of one thing. In NS and FF, I cannot add any padding to the right. IE is fine
Last edited by Lchad; Aug 17th, 2007 at 11:22. Reason: code tags added |
|
|||
|
Re: rounded boxes with CSS
Can't add padding to the right? Right of what?
Can you add a margin? |
|
|||
|
Re: rounded boxes with CSS
I needed to put the text in a p tag, and add padding to that. Without it, the text would flow all the way to the right edge of the conatiner, over the border, and neither padding nor margin worked on that side for some reason.
butm thanks for your help. I guess I will strip out my tables now and use these |
|
||||
|
Re: rounded boxes with CSS
Basically you want this to be done in 3 cuts as you planned for.
Top Middle Bottom
#wrapper will contol the width of the elements.
Last Blog Entry: Apps every Mac based web dev should consider (Jul 10th, 2008)
Last edited by moojoo; Aug 17th, 2007 at 14:48. |
|
||||
|
Re: rounded boxes with CSS
Have a look at the 'Cover' page on the newsletter. It has a rounded corner box and it was as easy as pie to make
Link to newsletter: www.creativecoding.webforumz.com Hope it gives you another option. |
![]() |
| Tags |
| css boxes |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| css rounded boxes ontop of each other | Gurpreet82 | Web Page Design | 7 | Feb 22nd, 2007 22:45 |
| css rounded corners | geoffmuskett | Web Page Design | 8 | Jan 4th, 2007 20:40 |
| Css rounded div corners | AdRock | Web Page Design | 2 | Aug 7th, 2006 13:25 |
| Rounded Rectangle | gwx03 | Graphics and 3D | 2 | Dec 16th, 2003 10:31 |