Ok, so this one is baffling me. But I am sure it will be easy for css guru's. I have a layout that calls for 4 boxes with an image background. The boxes are laid out in the shape of a cross:
2
1 3
4
I have been trying and trying to get them aligned properly and can not get it. here is the HTML code:
<!-- Boxes --> <div id="box_wrap"> <div id="box_1"></div> <div id="box_2"></div> <div id="box_3"></div> <div id="box_4"></div> </div>
And here is the css code:
/* boxes */ #box_wrap { margin:0 auto; width:840px; height:538px; } #box_1{ margin: 131px 15px 0 0; float:left; height:232px; width:270px; background:url(../images/box_1.png) no-repeat; } #box_2{ margin: 0 0 0 285px; height:232px; width:270px; background:url(../images/box_2.png) no-repeat; } #box_3{ margin: 131px 0 0 0; float:right; height:232px; width:270px; background:url(../images/box_3.png) no-repeat; } #box_4{ margin: 0 44px 0 289px; height:232px; width:270px; background:url(../images/box_4.png) no-repeat; } <code> Any and all help would be appreciated. Thanks everyone.
This is one, but not
This is one, but not necessarilly the only way to do it.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html lang="en" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <meta name="generator" content= "HTML Tidy for Linux/x86 (vers 25 March 2009), see <a href="http://www.w3.org" rel="nofollow">www.w3.org</a>" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>... Test ...</title> <style type="text/css"> /*<
Thanks in advance.
I was able to the..
I was able to get the background images in and the margins set but realized once the margins we set that it's the wrong layout. I need the top and bottom boxes to be in the middle of the right and left boxes. Do you think there is an easy fix for that?
Thanks Gary I appreciate your help on this.
I might try using absolute or
I might try using absolute or relative positioning to get the where you need'em. just be sure you understand the two techniques fully before doing so.
Will do thanks
I will try that thanks
For modern browsers, and even
For modern browsers, and even IE8, it's a trivial matter. The kicker is IEs 6&7. To follow my fix for those idiot browsers, refer to centering inline elements vertically, which I've adapted to center block level elements.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html lang="en" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <meta name="generator" content= "HTML Tidy for Linux/x86 (vers 25 March 2009), see <a href="http://www.w3.org" rel="nofollow">www.w3.org</a>" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>... Test ...</title> <style type="text/css"> /*<![CDATA[*/ body {} p { font-size: 1em; } div { } #wrapper { display: table; margin: 1.5em auto 0; width: 810px; } .sub-wrapper { display: table-cell; vertical-align: middle; width: 270px; } .item { border: 1px dotted gray; margin: 1.25em; padding: .5em; } </style><!--[if lte ie 7]> <style type="text/css"> .sub-wrapper { float: left; height: 50em; /* must be set for IE6,7 */ } .item { display: inline-block; vertical-align: middle; } * html .item { display: inline; } b { display: inline-block; height: 100%; vertical-align: middle; } </style> <![endif]--> </head> <body> <div id="wrapper"> <div class="sub-wrapper"> <div class="item"> <h2>Item one</h2> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi euismod fermentum accumsan. Lorem ipsum dolor sit amet, consectetur adipiscing elit. In ante ipsum, aliquet tristique volutpat eget, consectetur eget erat! Integer vestibulum diam sodales nunc pellentesque nec tempus tellus suscipit. Nulla convallis quam vel ligula convallis ultrices. Morbi non justo.</p> </div><!--[if lte ie 7]><b></b><![endif]--> </div> <div class="sub-wrapper"> <div> <div class="item"> <h2>Item two</h2> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi euismod fermentum accumsan. Lorem ipsum dolor sit amet, consectetur adipiscing elit. In ante ipsum, aliquet tristique volutpat eget, consectetur eget erat! Integer vestibulum diam sodales nunc pellentesque nec tempus tellus suscipit. Nulla convallis quam vel ligula convallis ultrices. Morbi non justo.</p> </div> </div> <div> <div class="item"> <h2>Item three</h2> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi euismod fermentum accumsan. Lorem ipsum dolor sit amet, consectetur adipiscing elit. In ante ipsum, aliquet tristique volutpat eget, consectetur eget erat! Integer vestibulum diam sodales nunc pellentesque nec tempus tellus suscipit. Nulla convallis quam vel ligula convallis ultrices. Morbi non justo.</p> </div> </div> </div><!-- end sub-wrapper --> <div class="sub-wrapper"> <div class="item"> <h2>Item four</h2> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi euismod fermentum accumsan. Lorem ipsum dolor sit amet, consectetur adipiscing elit. In ante ipsum, aliquet tristique volutpat eget, consectetur eget erat! Integer vestibulum diam sodales nunc pellentesque nec tempus tellus suscipit. Nulla convallis quam vel ligula convallis ultrices. Morbi non justo.</p> </div><!--[if lte ie 7]><b></b><![endif]--> </div> </div><!-- end wrapper --> </body> </html>
cheers,
gary
Fieldset problème
Hello eveyone,
i'm a new comer, student in sustainable energy.
with some friend we created an association and the web site www.solaria.pro
one of my friend was the web master and he died climbing montaines in corsica.
and i have to manage the web site and a week ago i didn't no any thing about this world,
but there is good tutorials to help out, so i have learnt a lot but i think but i still find problemes,
the first one, is that i have created a Form and it is compose of to fieldset, i have put a class to one of them to be able in CSS to give them diferent colors for exemple.
i would like that the two of them to be next to itch other and not on top of itch other
could you give my a hand please,
because se commande position does not work, and background-position as well does not work.
>Thanks for the help
Comous
If this isn't spam, maybe you
If this isn't spam, maybe you should start your own thread instead of hijacking this one?
it isn't a spam, i'm hear
Hello, i dont understand what do you mean for start your owun thread, it is my one form that i want to creat.
can you tel my why i can't put the two fieldset next to itch other???
thanks. comous


