473,795 Members | 2,847 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2300
In article <sl************ ***********@pur gatory.abyss>,
Lukasz Grabun <gr****@purgato ry.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?
Correspondin g 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">B rand 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
3398
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 unordered list. How can I use a Style-Sheet to format the bullets to be aligned like the text above. The problem is the floating catamaran-image which is floating left around the first paragraph on this site.
3
10769
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 Internet Explorer (in Safari, Firefox, and other Mozilla-types), the box ends up overlapping with the second and third rows of the text (which are in an ordered list with some 'display: table-cell' formats defined in order to allow specific...
4
9557
by: Rajesh | last post by:
struct symbol { char ch; float probability; char *codeword; }; void get_user_input(struct symbol **sptr) { .....
3
1589
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 but I cannot get the center id=txt section to fix at 700px. Does anyone know how I can achieve this?
36
3053
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 get this kind of inconsistent result. -- ----------------------------------------------------------------------------- | Phil Howard KA9WGN | http://linuxhomepage.com/ http://ham.org/ |
4
2917
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 by the inner floating boxes. Without the float, it works as expected. Why? What is it I am missing here about the CSS box model? Thanks in advance for your help.
1
2552
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 this issue with all browsers. basically, im trying to float a picture on the left side of a paragraph.
31
2963
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 to float an image to the right. For ease of looking at the problem, I have stripped away other parts of the page layout, and have just included the "content" section in the examples below. The basic design of having a left column and a main...
4
2933
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 have a table which should fill between the two floating DIVs if there is space. If there's not space, it should push down and display as a separately centered table. IE (7) behaves as I would expect, but FF seems to overlay the right side of the...
0
9673
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9522
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10448
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10167
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10003
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7544
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6784
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5440
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3730
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.