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

CSS questions about padding and doctype

Here problem is that in Mozilla the logo "The Website" will not pad from the
edge.
http://www.clickatus.com/test/

Also, when I put in loose DOCTYPE it blows the whole thing... Help...
http://www.clickatus.com/test/1

Jul 21 '05 #1
5 4094
Once upon a time *Hello* wrote:
Here problem is that in Mozilla the logo "The Website" will not pad from the
edge.
Start with correcting your errors first. After that it may be easier
to find what's wrong.
http://www.clickatus.com/test/
Errors reported by the CSS validator at
http://jigsaw.w3.org/css-validator/validator-uri.html

* Line: 11 Context : body
Invalid number : background-color FCF1C6 is not a color value : FCF1C6

* Line: 24 Context : div.h_body
Invalid number : top only 0 can be a length. You must put an unit
after your number : 10

* Line: 28 Context : div.h_body
Invalid number : background-color E9BB0D is not a color value : E9BB0D

* Line: 29 Context : div.h_body
Invalid number : color C44E0B is not a color value : C44E0B

* Line: 36 Context : div.b_holder
Invalid number : top only 0 can be a length. You must put an unit
after your number : 60

* Line: 40 Context : div.b_holder
Invalid number : background-color F6D866 is not a color value : F6D866

* Line: 50 Context : div.m_body
Invalid number : padding only 0 can be a length. You must put an unit
after your number : 70 15 40 185

Also, when I put in loose DOCTYPE it blows the whole thing... Help...
http://www.clickatus.com/test/1


Same errors as abowe on this page.

--
/Arne

Top posters will be ignored. Quote the part you
are replying to, no more and no less! And don't
quote signatures, thank you.
Jul 21 '05 #2
On Sat, 21 May 2005 09:30:23 +0200, Arne <in*****@domain.invalid> wrote:

[a series of good observations]
Once upon a time *Hello* wrote:
Here problem is that in Mozilla the logo
"The Website" will not pad from the edge.


Start with correcting your errors first. After that it may be easier
to find what's wrong.
http://www.clickatus.com/test/


Errors reported by the CSS validator at
http://jigsaw.w3.org/css-validator/validator-uri.html

* Line: 11 Context : body
Invalid number : background-color FCF1C6 is not a color value : FCF1C6

* Line: 24 Context : div.h_body
Invalid number : top only 0 can be a length.


[...]

And in addition to all the errors already found, the CSS author should
be instructed to NOT use the "underscore" character in CSS selectors.

That character was not originally defined in CSS, as part of the
"forward compatible" set-up that CSS was designed to be.

--
Rex
Jul 21 '05 #3
Thank you all for comments. I still have questions. I fixed CSS but it still
will not pad, now even in IE.

(That is text string "The Website" should be padded from the edge by 15
pixels)
http://www.clickatus.com/test/2/
--------------

"Arne" <in*****@domain.invalid> wrote in message
news:3f************@individual.net...
Once upon a time *Hello* wrote:
Here problem is that in Mozilla the logo "The Website" will not pad from
the
edge.


Start with correcting your errors first. After that it may be easier
to find what's wrong.
http://www.clickatus.com/test/


Errors reported by the CSS validator at
http://jigsaw.w3.org/css-validator/validator-uri.html

* Line: 11 Context : body
Invalid number : background-color FCF1C6 is not a color value : FCF1C6

* Line: 24 Context : div.h_body
Invalid number : top only 0 can be a length. You must put an unit
after your number : 10

* Line: 28 Context : div.h_body
Invalid number : background-color E9BB0D is not a color value : E9BB0D

* Line: 29 Context : div.h_body
Invalid number : color C44E0B is not a color value : C44E0B

* Line: 36 Context : div.b_holder
Invalid number : top only 0 can be a length. You must put an unit
after your number : 60

* Line: 40 Context : div.b_holder
Invalid number : background-color F6D866 is not a color value : F6D866

* Line: 50 Context : div.m_body
Invalid number : padding only 0 can be a length. You must put an unit
after your number : 70 15 40 185

Also, when I put in loose DOCTYPE it blows the whole thing... Help...
http://www.clickatus.com/test/1


Same errors as abowe on this page.

--
/Arne

Top posters will be ignored. Quote the part you
are replying to, no more and no less! And don't
quote signatures, thank you.

Jul 21 '05 #4
Hello wrote:
Thank you all for comments. I still have questions. I fixed CSS but it still
will not pad, now even in IE.


I avoid using absolutely positioned elements whenever possible.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<HTML>
<HEAD>
<TITLE>Homepage</TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<STYLE type=text/css>
*{
padding: 0;
margin: 0;
}
BODY {
width: 100%;
height: 100%;
FONT: 1.3em Georgia, Tahoma, serif;
BACKGROUND-COLOR: white;
color: black;
}
..line1 {
FONT-SIZE: 1px;
HEIGHT: 10px;
BACKGROUND-COLOR: black;
color: black;
left: 0px;
}
#logo {
padding: 0 15px 0 0; /* top right bottom left */
FONT-SIZE: 2em;
COLOR: #c44e0b;
HEIGHT: 50px;
BACKGROUND-COLOR: #e9bb0d;
TEXT-ALIGN: right;
}
#menu {
padding: 15px 10px 0 20px;
FONT-WEIGHT: 900;
FONT-SIZE: 1em;
LEFT: 0px;
WIDTH: 143px;
TOP: 60px;
HEIGHT: 600px;
BACKGROUND-COLOR: #f6d866;
position: absolute;
}
#content {
padding: 5px 0 5px 178px;
/* use padding so content div doesn't appear beneath menu div */
/* 178 = menu div width+padding+5px padding: 143 + 10 + 20 + 5 */
FONT-SIZE: 1em;
COLOR: black;
BACKGROUND-COLOR: white
}
#menu A {
COLOR: #c44e0b;
TEXT-DECORATION: none
}
#menu A:hover {
COLOR: darkred
}
..clear{
clear: both;
}
</STYLE>
</HEAD>

<BODY>
<DIV class="line1"></DIV>
<DIV id="logo">The WebSite</DIV>
<DIV id="content">This is my body</DIV>
<DIV id="menu"><A
href="http://www.clickatus.com/test/2/#">Home</A><BR><BR>
<A href="http://www.clickatus.com/test/2/#">Products</A><BR><BR>
<A href="http://www.clickatus.com/test/2/#">Support</A><BR><BR>
<A href="http://www.clickatus.com/test/2/#">Contact Us</A>
</DIV>
<div class='clear'></div>
</BODY>
</HTML>
Jul 21 '05 #5
Hello wrote:
Thank you all for comments. I still have questions. I fixed CSS but it still
will not pad, now even in IE.

(That is text string "The Website" should be padded from the edge by 15
pixels)
http://www.clickatus.com/test/2/


Adding padding to the div extends the absolute box by that extra amount,
which is not what you want.
So, remove padding-right:15px; from your div.logo .

The inline content takes text-align:right and correctly sits flush right.
In order to give the padding to the inline content, wrap it in a span:
<div class="logo"><span>The WebSite</span></div>

Then apply the padding to the span in your stylesheet:
div.logo span {padding-right:15px;}

--
Gus
Jul 21 '05 #6

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

Similar topics

15
by: Eric | last post by:
According to my book, the padding property is defined for all elements. However, when I set the property for the element <A>, only the left the right padding is applied and not the top and bottom...
2
by: AGChandler | last post by:
Hi, I have a div (class = "brands") containing other divs, each of which contains an image. I'm trying to set padding around the images, and my style seems to work okay on all but Explorer (I'm...
6
by: Wayne | last post by:
MS IE 6 is not honoring padding-left for images? For example, with img style="padding-left: 20px;" align="right" width="216" height="75" src="g1/filename.gif" I dont see what I am doing...
5
by: Richard Shewmaker | last post by:
Hi. I've been using CSS for basic stuff, mostly concerning fonts. I want to get going with using CSS fully. Two days ago I purchased O'Reilly's "Cascading Style Sheets" and "CSS Cookbook." I've...
6
by: ~john | last post by:
I'm using DIVs in a test site for my page layout. It's working fairly well so far but there's 2 problems I'm having that I didn't have with tables. I'm sure it's just something small in my CSS. ...
11
by: Gérard Talbot | last post by:
Hello, <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <title></title> <style type="text/css"> body {background-color: white; color: black;}...
19
by: Edward | last post by:
Why is it when I have a DOCTYPE line in my HTML then "margin" and "padding" are ignored? This happens in both inline and stylesheet styles. It happens for both XHTML and HTML doctypes. It...
12
by: Koelner | last post by:
Hello all, am very frustrated because I can't get a simple table to display the same way in both browsers. It displays the way I want it to in Firefox but not in IE7 (Windows XP). 1) not sure if...
11
by: maya | last post by:
hi, I've been noticing lately that padding property is ADDING to dimensions of element, this is causing me lots of difficulties.. if for example I have this: <div class="divMore"...
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?
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
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
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,...

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.