473,404 Members | 2,174 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

Formatting Prob: Span Moves Outside Containing DIV

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

Apr 25 '07 #1
2 3701
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
Apr 25 '07 #2
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
Apr 25 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Dan Weeb | last post by:
Hi All, I have struggled through this far with help from many of you so thanks. I am stuck again. I am really new to this so don't be harsh :-) There are a few problems. You can run the script...
0
by: Darin McGrew | last post by:
Eric Meyer's <http://www.meyerweb.com/eric/css/inline-format.html> is very clear that it is not a simple introduction to the inline formatting model. Unfortunately, that's what I think I need. I...
3
by: ShadowMan | last post by:
Hi all I have something like <DIV style="border: 1px solid black"> <SPAN>left side text</span> <span>right side text</span> </div> Using CSS I would like to aling first SPAN on left and...
6
by: Timo | last post by:
I have this list of checkboxes displaying properly in Opera and IE, but cannot get it in Firefox. For some reason, in FF, the checkboxes creep farther and farther to the right across the page,...
12
by: dmieluk | last post by:
Problem: When moving between records, I need to control which combo/text boxes are displayed on the current form, dependent upon data in the current record. More: I building my first...
7
by: =?Utf-8?B?TG9zdEluTUQ=?= | last post by:
Hi All :) I'm converting VB6 using True DBGrid Pro 8.0 to VB2005 using DataGridView. True DBGrid has a MultipleLines property that controls whether individual records span multiple lines. Is...
11
nathj
by: nathj | last post by:
Hi, I am working on new version of a site that requires an application form for membership, this is so that certain features of the site are only available to members. The site is aimed at Church...
1
by: Josiwe | last post by:
I have a search program that returns an HTML string which I display to the user. I want to highlight the search terms. However a simple search and replace on the HTML causes problems. If the...
1
by: malathib | last post by:
Hi, I am facing a problem in using iframes. For example..<h2><font color="blue"><span class="article-title">Translation</span></font></h2><span class="subtitle">Malathi is a name</span> if i...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.