473,386 Members | 1,720 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,386 software developers and data experts.

Why doesn't this look right?

Hello all,

OK. Just for fun, I'm writing a two column layout with a header at the top,
just to see if I can sit down and write it from scratch (as opposed to
copying a template). It basically consists of a header, right column and
left columed wrapped in a wrapper <div>. It all seems to line up, but it
also seems to have a quirk.

See here: www.sayatnova.com/frameless.htm. View the source to see the code.
It validates.

In IE the height of the left column, which would house a menu, is
significantly smaller than the right column - even though they both consist
of only a <p> tag with three words. Both of the <div>'s have 5px padding.
You can see that the right column obviously has much more than 5px of
top/bottom padding. I kind of expect both <div>'s to look like the left
column (menu div).

In Firefox, both div's are of equal height, but they both have significant
top/bottom padding, even though I specify only 5px.

I've tried setting height: auto and tried leaving the height spec out
altogether, but the behavior doesn't change. Also, I was suspicious of any
margins of the <p> tag but, assuming that IE applies some sort of default
margin to <p>, that would affect both <div>'s, not just one. What am I
overlooking? Is it an IE bug? Something in my CSS?

Again I'm just experimenting to learn. In the past, I've just copied 2 colum
layouts from CSS tutorial sites. I just want to try and write one from
scratch.
--
Viken K.
http://home.comcast.net/~vikenk

Jan 27 '06 #1
2 1220
Deciding to do something for the good of humanity, Viken Karaguesian
<vikenkNO_SPAM@NO_SPAMcomcast.net> declared in
comp.infosystems.www.authoring.stylesheets:
www.sayatnova.com/frameless.htm. <snip> Also, I was suspicious of any
margins of the <p> tag but, assuming that IE applies some sort of default
margin to <p>, that would affect both <div>'s, not just one.
This *is* IE we're talking about. :-)
What am I
overlooking? Is it an IE bug?
Probably. IE can be pretty buggy when it comes to floats.
Something in my CSS?


Add

* {padding: 0; margin: 0;}

at the top of your CSS file. I always start my CSS with that - that way
it eliminates any default padding/margins browsers may have, and I can
set it all to whatever I want. In this case, it also fixes your problem.
:-)

--
Mark Parnell
================================================== ===
Att. Google Groups users - this is your last warning:
http://www.safalra.com/special/googlegroupsreply/
Jan 27 '06 #2
> Add

* {padding: 0; margin: 0;}

at the top of your CSS file. I always start my CSS with that - that way
it eliminates any default padding/margins browsers may have, and I can
set it all to whatever I want. In this case, it also fixes your problem.
:-)


Thanks, Mark.

I added p { margin: 0; padding: 0; } to my css and the uneven height
went away. However, I still find it wierd that the box height was
uneven when IE was apply the default margin/padding to <p> tag. If they
were identical in html code, why the uneven size?

It must have something to do with the float. When I float the content
div left (so now both div's are floated left), the box sizes equalize.
Although if I left-float the content (right) div, I *must* specify a
width, otherwise it's not automatically filling the remaining width of
it's containing div. It only widens as much as it needs to accomodate
the text.

Thanks for the reply.

Viken K.

Jan 27 '06 #3

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

Similar topics

44
by: Mariusz Jedrzejewski | last post by:
Hi, I'll be very grateful if somebody can explain me why my Opera 7.23 (runing under linux) doesn't show me inner tables. Using below code I can see only "inner table 1". There is no problem with...
3
by: JHR | last post by:
Hey all, I'm trying to make a sidebar box float to the right of various items, and for those items to wrap if a user shrinks his browser window. Instead, in every browser I've tried except for...
34
by: Xah Lee | last post by:
i have a very simple html doc using the following style: <style type="text/css"> ..x-note {background-color:#afeeee; margin:1ex; padding:1ex; float:right; line-height:130%; width:60ex;...
12
by: Rhino | last post by:
I am having an odd problem: the sqlj command on my system doesn't work. I am running DB2 (LUW) V8 (FP8) on WinXP. I haven't done an sqlj program since Version 6 of DB2 (LUW) so I checked the...
149
by: Christopher Benson-Manica | last post by:
(Followups set to comp.std.c. Apologies if the crosspost is unwelcome.) strchr() is to strrchr() as strstr() is to strrstr(), but strrstr() isn't part of the standard. Why not? --...
3
by: Charles Law | last post by:
I have just been playing with AutoScale and I am unhappy with the way it appears to work. I have a form created on a desktop m/c where the screen font is Normal (96 dpi). The form looks fine at...
21
by: Dmitry Anikin | last post by:
I mean, it's very convenient when default parameters can be in any position, like def a_func(x = 2, y = 1, z): ... (that defaults must go last is really a C++ quirk which is needed for overload...
6
by: MZ | last post by:
Hello! The following js code doesn`t work fine on Firefox and I don`t know why. I have table with 30 rows and on IE I click once on analyse button and it fills my cells automaticaly, but when I...
39
by: alex | last post by:
I've converted a latin1 database I have to utf8. The process has been: # mysqldump -u root -p --default-character-set=latin1 -c --insert-ignore --skip-set-charset mydb mydb.sql # iconv -f...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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...

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.