CSS h1 not working

  • (2 Pages)
  • +
  • 1
  • 2

26 Replies - 6936 Views - Last Post: 11 January 2011 - 06:38 PM

#16 eZACKe  Icon User is offline

  • Garbage Collector

Reputation: 120
  • View blog
  • Posts: 1,278
  • Joined: 01-June 09

Re: CSS h1 not working

Posted 10 January 2011 - 05:38 PM

Yes that fixed it.

Is there a reason why an external stylesheet worked but styling within the same file didn't?
Was This Post Helpful? 0
  • +
  • -

#17 EnvXOwner  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 357
  • View blog
  • Posts: 2,319
  • Joined: 10-August 09

Re: CSS h1 not working

Posted 10 January 2011 - 05:44 PM

I don't know. Just always use an external stylesheet. It helps you to not produce repetitive code.
Was This Post Helpful? 1
  • +
  • -

#18 KingCuddles  Icon User is offline

  • D.I.C Regular

Reputation: 176
  • View blog
  • Posts: 496
  • Joined: 20-December 08

Re: CSS h1 not working

Posted 11 January 2011 - 05:04 AM

View PosteZACKe, on 10 January 2011 - 10:53 PM, said:

I am only just beginning beginning with HTML/CSS and not trying to make anything that will actually be used. Right now I'm learning how to work with tables.


It doesn't matter if it is actually going into production or not, using tables for layout is bad practice, and if your just beginning why waste time learning the wrong way?
Was This Post Helpful? 2
  • +
  • -

#19 eZACKe  Icon User is offline

  • Garbage Collector

Reputation: 120
  • View blog
  • Posts: 1,278
  • Joined: 01-June 09

Re: CSS h1 not working

Posted 11 January 2011 - 12:12 PM

View PostKingCuddles, on 11 January 2011 - 08:04 AM, said:

View PosteZACKe, on 10 January 2011 - 10:53 PM, said:

I am only just beginning beginning with HTML/CSS and not trying to make anything that will actually be used. Right now I'm learning how to work with tables.


It doesn't matter if it is actually going into production or not, using tables for layout is bad practice, and if your just beginning why waste time learning the wrong way?


Sorry, I didn't know it was bad practice.

I guess I have Luke Welling and Laura Thomson to blame for that one :oops:
Was This Post Helpful? 1
  • +
  • -

#20 Shane Hudson  Icon User is offline

  • D.I.C Technophile
  • member icon

Reputation: 343
  • View blog
  • Posts: 1,286
  • Joined: 06-December 09

Re: CSS h1 not working

Posted 11 January 2011 - 12:27 PM

EnvXOwner, I feel sorry for you after reading this thread!

eZACKe, just google for "Bad website design practises" or something like that. You will probably get a list of about 20 saying things like:

  • NO TABLES
  • No animated gifs
  • No automatic sound
  • No blinding colours


These are all things that website designers consider to be "from the 90s" and should be left there.

I understand that you are learning PHP first. Not quite sure about the logic there... you really should have a strong understanding of html and css before you learn PHP. But if you do it properly, it is not hard.

Tables = tabular data. They are very important still (though the code for them is also still horrendous) but not for layouts. Tables should not be used for layouts. It will confuse you, confuse the browser and look very ugly.

Good luck and if you have any more questions just ask!
Shane
Was This Post Helpful? 2
  • +
  • -

#21 mhollis  Icon User is offline

  • D.I.C Head

Reputation: 16
  • View blog
  • Posts: 61
  • Joined: 10-April 10

Re: CSS h1 not working

Posted 11 January 2011 - 12:48 PM

Shane is correct.

But I would like to try another tack with respect to tables versus <div> tags.

Look at your code with the tables. Better yet, let me post some:
Spoiler

The above was made with Microsoft's Front Page and anyone who has ever seen that kind of code knows it's truly garbage. But what I want you to do is look at the content section. You have many styles, fonts and so on described inline and not in any external style sheet. And the entire page is a set of tables.

Now, look at the content in a page that is properly laid out with <div> tags (this is the same page, reverse-engineered and with a very good menu design by CSS Menu Writer):
Spoiler

Now, notice that without all of the inline style junk, everything is very readable in the page. And I'm talking about reading it as code, not as a web page. There are very few inline styles. Everything is readable, there is a proper doctype declaration.

Designing a page with tables means you clutter up your text with tons of garbage the search engines have to search through. And pages like that will never get to the top of the "food chain" when it comes to the search engines. And I believe that is a direct result of using inline styling and tables to design your website.

Additionally, if you define everything with <div> tags and all text in style sheets, if someone says to you, "change this," you can make the change in a style sheet and it echos throughout the entire web site..
Was This Post Helpful? 3
  • +
  • -

#22 Dogstopper  Icon User is offline

  • The Ninjaducky
  • member icon



Reputation: 2870
  • View blog
  • Posts: 11,021
  • Joined: 15-July 08

Re: CSS h1 not working

Posted 11 January 2011 - 12:54 PM

eZACKe, I am going through that book right now myself. I would ignore the HTML and CSS at the moment because they did say at the beginning of the book that they were focusing on teaching you PHP/MYSQL, not HTML/CSS. That's because they were assuming a designer did that for you, so they just gave you something to work with in the examples, not to use in production code.

(The PHP/MYSQL is production-quality, but the HTML/CSS is not).
Was This Post Helpful? 2
  • +
  • -

#23 eZACKe  Icon User is offline

  • Garbage Collector

Reputation: 120
  • View blog
  • Posts: 1,278
  • Joined: 01-June 09

Re: CSS h1 not working

Posted 11 January 2011 - 12:57 PM

View PostDogstopper, on 11 January 2011 - 03:54 PM, said:

eZACKe, I am going through that book right now myself. I would ignore the HTML and CSS at the moment because they did say at the beginning of the book that they were focusing on teaching you PHP/MYSQL, not HTML/CSS. That's because they were assuming a designer did that for you, so they just gave you something to work with in the examples, not to use in production code.

(The PHP/MYSQL is production-quality, but the HTML/CSS is not).


Yeah that's basically what I'm doing. I am trying to pick up the basics of HTML/CSS as I go, but I'm not about to go and change anything in it because I'm more focused on messing around with the PHP now.

By the way, what do you think of the book? I'm thoroughly enjoying it.



Thanks to everyone who replied. It gave me a lot of insight into HTML/CSS and now I know what pitfalls not to fall into when I really start digging deeper into that stuff.
Was This Post Helpful? 0
  • +
  • -

#24 Dogstopper  Icon User is offline

  • The Ninjaducky
  • member icon



Reputation: 2870
  • View blog
  • Posts: 11,021
  • Joined: 15-July 08

Re: CSS h1 not working

Posted 11 January 2011 - 01:01 PM

I think it's great and I love the case studies at the end. I'm doing the mail server one right now. I definitely know my stuff after reading it!
Was This Post Helpful? 0
  • +
  • -

#25 Shane Hudson  Icon User is offline

  • D.I.C Technophile
  • member icon

Reputation: 343
  • View blog
  • Posts: 1,286
  • Joined: 06-December 09

Re: CSS h1 not working

Posted 11 January 2011 - 01:03 PM

View PostDogstopper, on 11 January 2011 - 06:54 PM, said:

eZACKe, I am going through that book right now myself. I would ignore the HTML and CSS at the moment because they did say at the beginning of the book that they were focusing on teaching you PHP/MYSQL, not HTML/CSS. That's because they were assuming a designer did that for you, so they just gave you something to work with in the examples, not to use in production code.

(The PHP/MYSQL is production-quality, but the HTML/CSS is not).


Dogstopper, I expected this would be the case. I recently bought "Build Your Own Database Driven Web Site Using PHP & MySQL" by Kevin Yank as a reference guide (too often I find myself without the internet and needing reference) and he also says the same thing.

It is worth noting that a lot of PHP websites do create tables, this is because data from a database is quite often useful to be shown in tabular form (a member list for example). So tables are important to learn (though of course you can do the same in html using css to make it look like a table, but I am not sure on the general opinion of that in website standards groups).
Was This Post Helpful? 0
  • +
  • -

#26 EnvXOwner  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 357
  • View blog
  • Posts: 2,319
  • Joined: 10-August 09

Re: CSS h1 not working

Posted 11 January 2011 - 03:05 PM

View PosteZACKe, on 11 January 2011 - 01:12 PM, said:

View PostKingCuddles, on 11 January 2011 - 08:04 AM, said:

View PosteZACKe, on 10 January 2011 - 10:53 PM, said:

I am only just beginning beginning with HTML/CSS and not trying to make anything that will actually be used. Right now I'm learning how to work with tables.


It doesn't matter if it is actually going into production or not, using tables for layout is bad practice, and if your just beginning why waste time learning the wrong way?


Sorry, I didn't know it was bad practice.

I guess I have Luke Welling and Laura Thomson to blame for that one :oops:

Guess what. I have the same book. For the first example about Bob's Auto Parts I was able to do without using a table for layout. I actually didn't use CSS because I really didn't care about making it "pretty".
Was This Post Helpful? 0
  • +
  • -

#27 Sergio Tapia  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 1252
  • View blog
  • Posts: 4,168
  • Joined: 27-January 10

Re: CSS h1 not working

Posted 11 January 2011 - 06:38 PM

Press Ctrl+F5 to hard refresh the referenced stylesheet.
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2