A very simple

This is a discussion on "A very simple" within the Web Page Design section. This forum, and the thread "A very simple are both part of the Design Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old Jan 23rd, 2007, 19:55
Junior Member
Join Date: Jan 2007
Location: Seattle, WA
Age: 27
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
A very simple

I'm not new to web design, nor am I new to CSS, but I am really frustrated by the differences in appearance between browsers of even the most SIMPLE elements. For example, in my .css file I have

#title_box {
width:600px;
background-color: #66CCFF;
border: 5px double #000000;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 24px;
font-weight: bold;
font-variant: small-caps;
vertical-align: middle;
}

then in my .html file:

<div id="title_box"><p align="center">Title</p></div>

Below is what I get from this very, very basic snippet. First of all, which one is working as intended, and second, what can I do to make sure that from the start of my page, it looks "right" in both major browsers?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Jan 23rd, 2007, 20:17
Elite Veteran
Join Date: Aug 2005
Location: That Place
Posts: 2,044
Blog Entries: 1
Thanks: 0
Thanked 37 Times in 37 Posts
Re: A very simple

first off <div id="title_box"><p align="center">Title</p></div> is a bit excessive. Align="center" should not be in that opening paragraph tag. Instead set text-align:center in the parent divs css.

Second the variance is due to the browsers differences in padding on the paragraph element. You can specify the padding/margin in your CSS as well.

You could start by adding:

* {
padding:0;
margin:0;
}

To the top of your CSS to strip all default margins and padding.
__________________

Last Blog Entry: Apps every Mac based web dev should consider (Jul 10th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Jan 24th, 2007, 11:53
Elite Veteran
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: A very simple

Also ... if it's a title, shouldn't you be using headings?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Jan 24th, 2007, 13:58
Elite Veteran
Join Date: Aug 2005
Location: That Place
Posts: 2,044
Blog Entries: 1
Thanks: 0
Thanked 37 Times in 37 Posts
Re: A very simple

Quote:
Originally Posted by karinne View Post
Also ... if it's a title, shouldn't you be using headings?
I was not going to go that deep into it but good point!

<h1> would be good.
__________________

Last Blog Entry: Apps every Mac based web dev should consider (Jul 10th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old Jan 24th, 2007, 16:35
Junior Member
Join Date: Jan 2007
Location: Seattle, WA
Age: 27
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Re: A very simple

Thanks for the responses!


Correct me if I am mistaken, but is this the answer I'm essentially being given? :

"The browsers have different ways of handling attributes that you choose to leave undefined. To avoid this, define all of them explicitly, i.e. padding, etc."


Also, as far as the example itself, it looks, awful, and is inefficient because it was not designed to ever be used. It was a quick way of creating a situation I could apply the question to. The snippets were also removed from context, and the text "title" was added to make sure some text was present, etc...

Last edited by EdgeWalker; Jan 24th, 2007 at 16:36. Reason: Corrected a minor grammar mistake.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6  
Old Jan 24th, 2007, 16:37
Elite Veteran
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: A very simple

Quote:
Originally Posted by EdgeWalker View Post
Thanks for the responses. Correct me if I am mistaken, but is the answer I'm being given essentially:

"The browsers have different ways of handling attributes that you choose to leave undefined. To avoid this, define all of them explicitly, i.e. padding, etc."
Yes ... It's easier when you just set all your elements to margin: 0 and padding: 0 like moojoo stated in his first reply. Then, it's easier to manage margins and padding accordingly.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7  
Old Jan 24th, 2007, 16:42
Junior Member
Join Date: Jan 2007
Location: Seattle, WA
Age: 27
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Re: A very simple

I guess I just assumed that css specifications, (like most other coding/programming specs) would include what the browser is supposed to do with any attributes that are not defined by the user or designer. Maybe they are, and one of my buddies up there (Internet Exploder, perhaps?) isn't following the spec.

That will teach me to assume!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8  
Old Jan 24th, 2007, 16:50
Ryan Fait's Avatar
Elite Veteran
Join Date: May 2006
Location: Las Vegas
Posts: 3,787
Thanks: 0
Thanked 0 Times in 0 Posts
Re: A very simple

Margin and padding are really the only two you might want to do. Just a note though, for vertical centering of text, a more x-browser way of doing it is using line-height in either shorthand or longhand.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #9  
Old Jan 24th, 2007, 20:27
Up'n'Coming Member
Join Date: Aug 2006
Location: California
Age: 20
Posts: 58
Thanks: 0
Thanked 0 Times in 0 Posts
Re: A very simple

I have a question concerning the <h1> and <h2> elements. Im getting the impression that these tags should be used instead of the <p class=> code. This might be a bit basic, but should the <h1> tags only be used for headers, and shouldnt be tampered?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #10  
Old Jan 24th, 2007, 20:37
Elite Veteran
Join Date: Aug 2005
Location: That Place
Posts: 2,044
Blog Entries: 1
Thanks: 0
Thanked 37 Times in 37 Posts
Re: A very simple

Heading 1 <h1>
Heading 2 <h2>
Heading 3 <h3>
Heading 4 <h4>
etc....

And no you would not place a <h1> etc in a paragraph.
__________________

Last Blog Entry: Apps every Mac based web dev should consider (Jul 10th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #11  
Old Jan 25th, 2007, 15:12
Up'n'Coming Member
Join Date: Aug 2006
Location: California
Age: 20
Posts: 58
Thanks: 0
Thanked 0 Times in 0 Posts
Re: A very simple

OK that makes sense. What I was saying was that I had used h1 before in a paragraph to modify text easier, and just styled it up in the CSS. Im gonna guess that other browsers treat the headers in different ways.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #12  
Old Jan 25th, 2007, 15:26
Ryan Fait's Avatar
Elite Veteran
Join Date: May 2006
Location: Las Vegas
Posts: 3,787
Thanks: 0
Thanked 0 Times in 0 Posts
Re: A very simple

CSS is for making text look different. XHTML is for structure.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
browsers, css

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Just some simple css help! Please?? lefty Starting Out 9 Apr 28th, 2008 10:19
Very Simple Cms christopher Website Planning 3 Apr 26th, 2008 17:19
Something really simple delusion Web Page Design 10 Jul 4th, 2007 17:59
Just want simple Background Song (.mp3) and a simple start/stop. BlackReef Flash & Multimedia Forum 4 Jun 28th, 2007 07:04
simple GET moiseszaragoza JavaScript Forum 4 Mar 23rd, 2007 23:35


All times are GMT. The time now is 19:10.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42