Click here to get back home

Formatting Prob: Span Moves Outside Containing DIV

 HomeNewsGroups | Search | About
 comp.infosystems.www.authoring.html    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Formatting Prob: Span Moves Outside Containing DIV pbd22 04-25-2007
Get Chitika Premium
Posted by pbd22 on April 25, 2007, 8:54 am
Please log in for more thread options


Hi.

I have been wrestling with getting a span (or a few)
to live inside a few divs. I want to put padding around
the span but it seems to move independent of the divs
even though there is no float. I am wondering if display:block
is messing stuff up? Or, something else?

do you see what I am doing wrong?

thanks.

Code:

<div style="display: block;" class="bluePanel" width="100%"
tabcolor="blue" panelurl="http://localhost:2032/Site/Tabs.aspx"
id="panel_today">
<div>
<span style="padding: 5px; background-color: white;">one</span>
<span>two</span>
<span>three</span>
<span>four</span>
</div>
</div>

the bluePanel CSS:

Code:

.bluePanel
{
background: #acc6d5;
         padding-left:5px;
         border: 1px solid black;
         border-top: 0px;
}


Edit/Delete Message


Posted by John Hosking on April 25, 2007, 11:01 am
Please log in for more thread options


pbd22 wrote:

> I have been wrestling with getting a span (or a few)
> to live inside a few divs. I want to put padding around
> the span but it seems to move independent of the divs
> even though there is no float.

Unfortunately, I don't understand your problem. What do you mean, "it
moves?" The padding appears for me, but the content of the span remains
inline, as is its wont. I don't see what "moves."

> I am wondering if display:block is messing stuff up?

Shouldn't oughta. A DIV is display:block by default.

> Or, something else?
>
> do you see what I am doing wrong?

No, but again, I don't understand the question. I've pasted your code
into a file of my own and done some "testing" but I'm not sure what I'm
looking for. That said, I'm thinking you may not have tried to validate
the code. Visit http://validator.w3.org/ for the HTML,
http://jigsaw.w3.org/css-validator/ for the CSS.

You might also try it with a simplified test case, one which doesn't
have a bunch of Java in it, for example.

>
> Code:

As always, a URL is preferable to pasted, incomplete code.

>
> Edit/Delete Message

Is this your sig? Catchy ;-)

HTH
--
John

Posted by Bergamot on April 25, 2007, 3:18 pm
Please log in for more thread options


pbd22 wrote:
>
> I want to put padding around
> the span but it seems to move independent of the divs
> even though there is no float.
>
> Code:

Don't post code, post a URL. If your domain isn't publicly available,
find someplace else that is and upload a test page there. Most ISPs give
their users some amount of free web space, and there are free servers
like yahoo/geocities if you're desperate.

Make it easy for people to help you and you'll get a better response.
Posting code is not the way, posting a URL is.

--
Berg

Similar ThreadsPosted
Anchor Tag with #Name Moves Entire Window Up to X Coordinate September 2, 2004, 11:16 am
clickable image w/maps moves when clicked April 10, 2008, 10:18 am
Tidy message prob September 22, 2005, 11:19 am
encoding prob w/a google widget.. September 18, 2008, 3:59 pm
Dynamic image which is highlighting/increasing the text/area when the curser moves over it? July 20, 2006, 1:45 am
table formatting February 6, 2005, 3:06 pm
TextArea - Formatting text August 24, 2004, 11:57 am
Bidirectional control (formatting) characters August 16, 2006, 12:56 pm
FF and IE with span February 6, 2007, 1:46 pm
a name vs. span id? May 26, 2008, 2:27 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap