Divs in a row

This is a discussion on "Divs in a row" within the Web Page Design section. This forum, and the thread "Divs in a row are both part of the Design Your Website category.



Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Nov 15th, 2005, 13:12
Junior Member
Join Date: Aug 2005
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Divs in a row

I'm trying to make some variable -length custom buttons by using a div containing text with an image background. Fair play. But to make it a rounded button I want to have another image either side of the text div. I can't figure out how to put them all in a row, with no gaps between them, and have the center div vary in length according to the length of the text.
Have a look:
http://www.aocd00.dsl.pipex.com/buttons.html
Code: Select all
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"
"http://www.w3.org/TR/REC-html40/strict.dtd">
<html>
<body>
<div style="background: white url(left.jpg) no-repeat; height:43px;"></div><div style="background-image: url(mid.jpg); height:43px;vertical-align:middle;">hello</div>
<div style="background: white url(right.jpg) no-repeat;height:43px; "></div>
</body>
</html>
Reply With Quote

  #2 (permalink)  
Old Nov 15th, 2005, 15:58
Junior Member
Join Date: Aug 2005
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Divs in a row

Is ok I've got it fixed now using widths and floats:

For the final touch I've brought the text into the middle of the button by putting it in a <p> with a top padding.

Code: Select all
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"
  "http://www.w3.org/TR/REC-html40/strict.dtd">
<html>
<body>
<div style="background: white url(left.jpg) no-repeat; height:43px; float:left; width:30px;"></div>
<div style="background-image: url(mid.jpg); height:43px;vertical-align:middle;text-align:center;float:left;color:white; font-weight:bold;"><p style="padding-top:10px">I've got a luvverly bunch of coconuts</p></div>
<div style="background: white url(right.jpg) no-repeat;height:43px;float:left; width:30px; "></div>
</body>
</html>
Reply With Quote
Reply

Tags
divs, row

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Having two divs which do not affect each other? LGS Web Page Design 11 Oct 28th, 2007 23:41
Style with DIVS cyberseed Web Page Design 5 Oct 31st, 2006 14:37
Divs in a row hessodreamy Web Page Design 5 Feb 17th, 2006 18:40


All times are GMT. The time now is 16:07.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43