473,406 Members | 2,620 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,406 software developers and data experts.

padding/margin in (non)floating sections

There's a page

http://www.dwarfscorner.com

It looks as nice as I could design it; I like it, I think. There's
just one thing I can't get along with: the vertical allignment of h2
in grey and white sections. The former is noticably lower than the
latter! And I can't figure out why it is this way. The grey section is
floated - does it influence the standard padding/margin in any way?
Corresponding CSS style file can be found here

http://www.dwarfscorner.com/css/style.css

Grey section is labeled #sideblog, the white one - .blog. Headers look
OK in FireFox whilst they're altered in IE and old Mozillas.

Anyone?

--
Lukasz Grabun
(reply-to field is fake, use grabek (at) acn dot waw dot pl to reply)
Jul 20 '05 #1
2 2259
In article <sl***********************@purgatory.abyss>,
Lukasz Grabun <gr****@purgatory.abyss> wrote:
There's a page

http://www.dwarfscorner.com

It looks as nice as I could design it; I like it, I think. There's
just one thing I can't get along with: the vertical allignment of h2
in grey and white sections. The former is noticably lower than the
latter! And I can't figure out why it is this way. The grey section is
floated - does it influence the standard padding/margin in any way?
Corresponding CSS style file can be found here

http://www.dwarfscorner.com/css/style.css


I believe the difference is because of what's between the beginning of
each DIV and the first H2:

<div id="sideblog">
<h2 class="title">
Corner's Specific
</h2>

vs.

<div class="blogbody">

<a name="000022"></a>
<h2 class="title">Brand new round</h2>

While it's true multiple lines or spaces reduce to one in HTML,
there's a difference between having one or more blank lines and not
having any.

(Aside: And is it valid to add a named anchor without any content? I
forget and am too lazy/busy right now to look it up.)

Some other comments on your CSS. Why declare all your H2s in the
sideblog as class "title"? If they're all going to look the same, do
without the class and change the CSS declaration from

.title

to

#sideblog h2

If you ever *do* have multiple H2 styles, make the lesser used one the
exception and declare a class for it. Although if you ever do do
that, make sure you shouldn't really use H3 instead.

Similarly, why have all those "side" divs if everything's an anchor?
Change that as follows:

#sideblog a
{
font-family:georgia, times, "times new roman", serif;
font-size:small;
font-weight:normal;
line-height: 140%;
padding: 10px 0 20px 0;
color: #c60;
text-decoration: underline;
}

#sideblog A:link { color: #c60; text-decoration: underline; }
[etc.]

I'm sure there's more examples of things that can be simplified in
your style sheet, but those were the two that struck me on a quick
glance. Your HTML will look much cleaner without all those extra
DIVs.

--
lkseitz (Lee K. Seitz) .at. hiwaay @dot@ net
WALLY: I believe God created the Earth because he hates people.
-- Scott Adams, Dilbert, 6 Mar 1999
Jul 20 '05 #2
On Wed, 03 Mar 2004 21:34:43 -0000, lkseitz (Lee K. Seitz) .at. hiwaay @dot@ net wrote:

While it's true multiple lines or spaces reduce to one in HTML,
there's a difference between having one or more blank lines and not
having any.


I cleaned up the code. It does not help, however :-(

I really am fed up with it. Can someone with a fresh look take a
glimpse?

[snip tips]

Thank you. Those are really useful.

--
Lukasz Grabun
(reply-to field is fake, use grabek (at) acn dot waw dot pl to reply)
Jul 20 '05 #3

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

Similar topics

2
by: Chris Gurk | last post by:
Hi Newsgroup, I am working on a website http://www.charter-yachtcharter.com/testsite/ (still in progress). There are two lists. The first is a simple paragraph (<p>-Tag), the second an...
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...
4
by: Rajesh | last post by:
struct symbol { char ch; float probability; char *codeword; }; void get_user_input(struct symbol **sptr) { .....
3
by: Harry | last post by:
Hi. I'm trying to get a page layout using css instead of tables, where the various sections have fixed widths even when you resize the browser window. The css below produces the correct layout...
36
by: phil-news-nospam | last post by:
Here is a simpler (no drop shadows) example of the padding bug I see: http://phil.ipal.org/usenet/ciwas/2006-05-08/buttons-1.html So far I find nothing in the CSS2 document that says I should...
4
by: Ivor Somerset | last post by:
Dear CSS community, The code below shows my problem. I have a containing DIV box into which I place floating boxes. As the background-color shows, the size of the containing box is not extended...
1
by: Eniac0 | last post by:
Hello, ive been recently appointed to transforming our table-full site into a nice accessible and table-free website. to make the story short, everything was going rather smoothly until i got...
31
by: Martin Clark | last post by:
Hello, I am daring to stick my head above the parapet and ask as question. I am working on redesigning a website to use CSS rather than tables for layout. I have come across a problem when trying...
4
by: tbirnseth | last post by:
I'm having trouble between IE and FF. For once, IE behaves as I would expect, but FF doesn't. Basically I have a container with two floating DIVs in it. One floats left and the other right. I then...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
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.