Jump to content

Can't insert code inbetween 2 <div>


ankhmor

Recommended Posts

Hi

Here's my code:

<style>
ul{
    margin: 0 auto;
}
ul.horizontal_list li{
margin: 0 auto;
    text-align: left;
    float: left;
    list-style: none;
    padding: 3px 10px 3px 10px;
    margin: 5px;
    border: 1px solid #CCC;
}
</style>

<div style="font-size: medium;border-color: #a7e3ff;border-style: solid;border-width: 1px;">
    <ul class="horizontal_list">
        <li>
		hey
		</li>
			        <li>
		hey1
		</li>
			        <li>
		hey2
		</li>
</ul>
</div>

 

And here's my problem.

The UL doesnt want to go into the DIV. The DIV appears as a thin strip and the UL is outside of it.

Here's a screenshot :

screenshotfz1.jpg

w334.png

 

Could you tell me how to fix this?

Thanks.

 

Link to comment
Share on other sites

OR even better you could do this properly by not adding any extra html markup just to attain a PRESENTATIONAL goal.

 

there is the rather lovely and simple method to get browser to make an element recognize it has content that takes up space by simply giving that parent container overflow: hidden;

 

this does have a couple of minor bugs but youi can play with different values of overflow (I have never used anything but hidden to get the result I wanted).

 

If you have problems you can use this method which is a little heavier on the code but is reliable...

 

http://www.positioniseverything.net/easyclearing.html

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.