Liquid widths

Y

Yehuda Katz

I need a way to have the width of a div automatically equal the inner
content.

My HTML:

<div class="botstrip" id="aboutstrip" style="display: none;">
<a href="#">About 1</a><p>|</p><a href="#">About 2</a><p>|</p><a
href="#">About 3</a></div>

My CSS:

div#pagewrapper div.botstrip a {
padding-left: 10px;
padding-right: 5px;
color: #091A86;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 11px;
font-weight: normal;
text-decoration: none;
}

div#pagewrapper div.botstrip p {
padding: 0;
margin: 0;
display: inline;
}

I set the display: none because I will unhide it later.

In Firefox, it works perfectly, and the <div> is only as wide as the
containing elements. In Internet Explorer, the <div> expands to the
width of the container.When I try to set width: 0px, which would
normally work, it breaks up the containing elements onto separate
lines.

Thoughts?
 
N

Neredbojias

With neither quill nor qualm, Yehuda Katz quothed:
I need a way to have the width of a div automatically equal the inner
content.

Normally a div does not expand to its content. Use a table.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top