twinturbotom
08-11-2011, 10:27 PM
I've created some example code that roughly conveys my troubles.
My page has images at the top and down the right hand side.
All of the images are in a single div; as much as I'd like to have a top div and a side div I have some other scripting that will not permit this.
the left side is then left open for some content...
all content works fine EXCEPT when I make my list a horizontal one (by floating the li tags) the list moves further down the page then I want....
Below is a quick an example... if you remove the ul li float:left the spacing between the h1 and ul li elements is fine.. but they are vertical...
I've been playing with block display for the images and other things.. any insight will be appreciated ...
In summary; i need a horizontal list below the h1 tag while their are images at the top and right sides of the page.....thanks...
<html>
<style>
body{
width: 800px;
}
ul li {
float: left;
}
</style>
<body>
<img src="http://www.codingforums.com/img/logo.gif" />
<img src="http://www.codingforums.com/img/logo.gif" />
<img style="float: right; display: block;" src="http://www.codingforums.com/img/logo.gif" />
<img style="float: right; display: block; clear: right;" src="http://www.codingforums.com/img/logo.gif" />
<img style="float: right; display: block; clear: right;" src="http://www.codingforums.com/img/logo.gif" />
<img style="float: right; display: block; clear: right;" src="http://www.codingforums.com/img/logo.gif" />
<h1>some header</h1>
<ul>
<li>why the gap above?</li>
<li>when</li>
<li>float for horizontal?</li>
</ul>
</body>
</html>
My page has images at the top and down the right hand side.
All of the images are in a single div; as much as I'd like to have a top div and a side div I have some other scripting that will not permit this.
the left side is then left open for some content...
all content works fine EXCEPT when I make my list a horizontal one (by floating the li tags) the list moves further down the page then I want....
Below is a quick an example... if you remove the ul li float:left the spacing between the h1 and ul li elements is fine.. but they are vertical...
I've been playing with block display for the images and other things.. any insight will be appreciated ...
In summary; i need a horizontal list below the h1 tag while their are images at the top and right sides of the page.....thanks...
<html>
<style>
body{
width: 800px;
}
ul li {
float: left;
}
</style>
<body>
<img src="http://www.codingforums.com/img/logo.gif" />
<img src="http://www.codingforums.com/img/logo.gif" />
<img style="float: right; display: block;" src="http://www.codingforums.com/img/logo.gif" />
<img style="float: right; display: block; clear: right;" src="http://www.codingforums.com/img/logo.gif" />
<img style="float: right; display: block; clear: right;" src="http://www.codingforums.com/img/logo.gif" />
<img style="float: right; display: block; clear: right;" src="http://www.codingforums.com/img/logo.gif" />
<h1>some header</h1>
<ul>
<li>why the gap above?</li>
<li>when</li>
<li>float for horizontal?</li>
</ul>
</body>
</html>