8 replies [Last post]
lukeprog
Offline
Regular
Last seen: 13 years 28 weeks ago
Joined: 2007-12-01
Posts: 14
Points: 0

The main content of each page on my site is contained within this:

[blah blah blah]

My CSS calls for margins & padding:

#article { margin-left: 10px; margin-right: 10px; padding-left: 10px; padding-right: 10px; }

But my content runs right up to the edge of the section. I want breathing room on both sides. How do I do it?

Example page: http://lukeprog.com/why-different.html
My CSS: http://lukeprog.com/style.css

DanA
DanA's picture
Offline
Elder
Last seen: 11 years 6 weeks ago
Timezone: GMT+2
Joined: 2004-08-14
Posts: 1087
Points: 2

span is an inline element

span is an inline element and width or height shouldn't be applied (unless you use display:block;)
Use div instead, choose a doctype that works and validate your code :
http://validator.w3.org/check?verbose=1&uri=http%3A%2F%2Flukeprog.com%2Fwhy-different.html

lukeprog
Offline
Regular
Last seen: 13 years 28 weeks ago
Joined: 2007-12-01
Posts: 14
Points: 0

Changing span to div didn't

Changing span to div didn't change anything.

thepineapplehead
thepineapplehead's picture
Offline
Guru
Last seen: 13 weeks 2 days ago
Joined: 2004-06-30
Posts: 9674
Points: 810

Have you validated your code?

Have you validated your code?

Verschwindende wrote:
  • CSS doesn't make pies

Deuce
Deuce's picture
Offline
Guru
Somewhere, USA
Last seen: 3 years 48 weeks ago
Somewhere, USA
Timezone: GMT-5
Joined: 2005-11-20
Posts: 4424
Points: 1843

I would recommend a valid

I would recommend a valid doctype to start.

all ยป http://dictionary.reference.com/browse/all

Google isn't a bunch of guys reading and grading web sites, it's more like a bunch of monkeys sniffing food and putting the good bananas at the top. -Triumph

lukeprog
Offline
Regular
Last seen: 13 years 28 weeks ago
Joined: 2007-12-01
Posts: 14
Points: 0

Amazing, that worked! Screw

Amazing, that worked!

Screw Nvu. I'm gonna hand-code this *beep*. And maybe bother to learn valid markup.

Triumph (not verified)
Anonymous's picture
Guru

lukeprog wrote:... And maybe

lukeprog wrote:
... And maybe bother to learn valid markup.

Maybe? You finally think it might be a good idea?

lukeprog
Offline
Regular
Last seen: 13 years 28 weeks ago
Joined: 2007-12-01
Posts: 14
Points: 0

Triumph wrote:lukeprog

Triumph wrote:
lukeprog wrote:
... And maybe bother to learn valid markup.

Maybe? You finally think it might be a good idea?

Well, it'll take a long time and I want to get down to writing content, already! Smile

thepineapplehead
thepineapplehead's picture
Offline
Guru
Last seen: 13 weeks 2 days ago
Joined: 2004-06-30
Posts: 9674
Points: 810

Content is king, yes, but it

Content is king, yes, but it goes hand in hand with valid markup Wink

Glad you got it fixed Laughing out loud

Verschwindende wrote:
  • CSS doesn't make pies