473,399 Members | 3,919 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,399 software developers and data experts.

erratic <div>

Hi

Testing in IE6

I have the following

doctype is xhtml strict

============

<div id="middlebox">
<div id="mnup">
<ul>.....</ul>
</div>
<div id="contentbox">
some text written
</div>
</div>
==============
where:
#middlebox {
width: 760px;
height: 300px;
margin-left: auto;
margin-right: auto;
background-color: white;
}

#mnup {
position: relative;
width: 150px;
padding-top: 20px;
float: left;
}

#contentbox {
background-color: white;
width: 605px;
height: 400px;
padding: 10px;
border: 1px solid black;
}
I want a padding in #contentbox. But when I do the div goes under #mnup
instead of on it's right, why ? Removing the padding places the div at the
right of #mnup.

Thanks
Sep 21 '05 #1
3 1463
On 21/09/2005 22:29, Bill wrote:

[snip]
#middlebox {
width: 760px;
height: 300px;
margin-left: auto;
margin-right: auto;
background-color: white;
The background and color properties should be paired. Not everyone may
have the same colour preferences as you (think desktop themes, for a start).
}

#mnup {
position: relative;
width: 150px;
padding-top: 20px;
float: left;
}

#contentbox {
background-color: white;
width: 605px;
height: 400px;
padding: 10px;
border: 1px solid black;
}


605 + 10 + 10 + 150 > 760

The width property applies to the content of an element. The padding,
border, and margin regions are added outside this area.

[snip]

Do you know that your content (#contentbox) is taller than your
container (#middlebox)?

Mike

--
Michael Winter
Prefix subject with [News] before replying by e-mail.
Sep 21 '05 #2
Hi
#contentbox {
background-color: white;
width: 605px;
height: 400px;
padding: 10px;
border: 1px solid black;
}


605 + 10 + 10 + 150 > 760

The width property applies to the content of an element. The padding,
border, and margin regions are added outside this area.


That's what I discovered yeah. Had to reduce width so it fits into 605px.

I began working with CSS a couple of days ago. I must build reflexes and
understanding of a lot of things we don't care in html.

Thanks
Sep 21 '05 #3
On 21/09/2005 23:00, Michael Winter wrote:
On 21/09/2005 22:29, Bill wrote:


[snip]
border: 1px solid black;
}


605 + 10 + 10 + 150 > 760

The width property applies to the content of an element. The padding,
border, and margin regions are added outside this area.


And despite saying that, I overlooked the border myself. Add two more
pixels to the left-hand side.

Mike

--
Michael Winter
Prefix subject with [News] before replying by e-mail.
Sep 21 '05 #4

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

Similar topics

13
by: Mikko Ohtamaa | last post by:
From XML specification: The representation of an empty element is either a start-tag immediately followed by an end-tag, or an empty-element tag. (This means that <foo></foo> is equal to...
1
by: Philo | last post by:
How do I select all <div> tags except those which contain a <table> tag somewhere within them? Example XML: <********************** sample input ***********************> <txtSectionBody>...
3
by: Paul Thompson | last post by:
When I put a <div ...> inside a <table> specification, functionality is not there. When I put the <table> inside the <div> everything works. Why is that?
3
by: Jens Kristensen | last post by:
I have a problem displaying a divbox containing a html-textarea - everything works fine with "normal" characters. However, when the textarea contains special chars like <P> or ' , the box fails to...
8
by: Daniel Hansen | last post by:
I know this must seem totally basic and stupid, but I cannot find any reference that describes how to control the spacing between <p>...</p> and <div>...</div> blocks. When I implement these on a...
3
by: Josef K. | last post by:
Asp.net generates the following html when producing RadioButton lists: <td><input id="RadioButtonList_3" type="radio" name="MyRadioButtonList" value="644"...
28
by: Kent Feiler | last post by:
1. Here's some html from a W3C recommendations page. <P>aaaaaaaaa<DIV>bbbbbbbbb</DIV><DIV>cccccccc<P>dddddddd</DIV> 2.Although I didn't think it would make any difference, I tried it with the...
5
by: Agix | last post by:
Hi there, Please check out : http://clarifysolutions.co.uk/certenroll/ The source is included below. This page is a test, so I can play about with paddings, margins and layouts using divs as...
8
prino
by: prino | last post by:
Hi all, I've written code (in REXX) that takes files in legacy languages (PL/I, COBOL, z/OS assembler, etc) and converts them into HTML in a format similar to what's displayed in the z/OS ISPF...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.