Welcome Guest ( Log In | Register )




                Web Hosting Guide

 
Reply to this topicNew Topic
Integrating Html And Css
aggie
post Oct 30 2006, 02:55 AM
Post #1


Newbie [ Level 1 ]
Group Icon

Group: Members
Posts: 4
Joined: 30-October 06
Member No.: 16,866


QUOTE(the_aggie10 @ Trap17.com)
Ok. Well i am writing this as a series of tutorials i will be doing on this subject, so enjoy. I hope this helps.


Introduction to HTML and CSS

HTML and CSS are to work together. HTML is what puts the characters on the page, while CSS is what makes everything look outreageous! For instance, I would use HTML if i wanted to put "Trap17 is the poop!" onto my page, although if i wanted to make it look nice like this by adding a font, and maybe some color, then I would use CSS.

Learn the HTML.
Ok this is my little into. to HTML.
In order to get words to appear on a page I would put
CODE
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
    <body>
          <p> This is the text that would appear!</p>
          </body>
          </html>

Now it does not matter how much you indent, or if you indent at all, but I do it cause it is easier to read through. So you have typed this into your text editor, such as notepad. Now it is time to see how it looks! Ok, save it as tutorial.html. Then go to your internet browser and click on File>Open> click on your file and BOOM! There it is. Congratulations, your first page (only applies to those who it applies to heh) Well you might have noticed it doesn't look very spiffy. Which is where the CSS comes in. But before we move onto that let me explain something. CSS adds stuff such as color or font. But you can still do a good bit of stuff in HTML for instance if you wanted to make the text bold it would be
CODE
<b>  Bold text here  </b>

This would look like this <b>Bold text here</b> Also this line:
QUOTE
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
is a <b>doctype</b>, which holds the rules for different versions of HTML.


Learn the CSS
Well now that you have gotten just a glimpse of HTML it is time to move on to styling it, which is what CSS does. You can do CSS directly from the HTML document or do it from a totally different document, I personally do it from a totally different one.
So, say that I wanted to style that text that we did previously.
CODE
p {
                           font-family: Arial, Helvetica, sans-serif;
                           color: blue;
                           }

Lets dissect this shall we? Ok the very first character "p" is a selector. It selects all of the "p" elements in the HTML. The "font-family" is of course fonts, but it is saying that the first choice is Arial, and if that is not available then Helvetica, or if all else fails sans-serif. As you could have guessed, the last part is saying that the color is to be blue. You cant really look at this without the HTML, so take a look at the next section!

Linking the two together
In case you were wondering, these two don't just magically find each other. To link the two together you add a link element to it. Here is an example: say you saved the above code as style.css, then in the HTML before you put the closing head tag (</head>) you would add
CODE
<link href="style.css" rel="stylesheet" type="text/css" />
So, you have got the HTML document from earlier saved as tutorial.html correct? Well go in there and add the link element, so ultimately it will look like this:
CODE

        <html>
            <link href="style.css" rel="stylesheet" type="text/css" />
    <body>
          <p> This is the text that would appear!</p>

        </body>
        </html>
          

Now save that file. and go to your internet browser, and again File>Open>tutorial.html and there you go, the text looks good, but you may have noticed the background looks like total poop, that is for next time. I hope you enjoyed this!

-Aggie
Go to the top of the page
 
+Quote Post
FirefoxRocks
post Oct 30 2006, 11:47 PM
Post #2


Super Member
Group Icon

Group: [HOSTED]
Posts: 875
Joined: 12-July 06
From: Ontario, Canada
Member No.: 14,464
myCENTs:89.55


First of all, you should teach HTML, you should teach XHTML.

Second of all, y did you put yoru tutorial in quotes?
Go to the top of the page
 
+Quote Post
Chesso
post Nov 1 2006, 01:55 AM
Post #3


Teh Coder
Group Icon

Group: Members
Posts: 1,053
Joined: 18-April 06
From: Australia
Member No.: 12,833
myCENTs:89.25


Looks like he was quoting his own post from another from (namely trap17) and it might contain content written by another.

Makes sense to me.

I'd leave the doctype and strict out of a starters tutorial though, I think that should be covered as a seperate topic for HTML/XHTML.
Go to the top of the page
 
+Quote Post
jlhaslip
post Nov 1 2006, 06:07 AM
Post #4


Advanced Member
Group Icon

Group: Members
Posts: 197
Joined: 15-November 05
From: Inland from the Left Coast of Canada
Member No.: 9,627
myCENTs:44.50


Chesso,

The DTD is an integral part of the page and it would be best if it was included in all pages, especially beginner's pages, since an absence of the DTD causes Browsers to go in to Quirks Mode. Quirks Mode is not good if you are attempting to get your page to behave the same in all Browsers. Each Browser interprets thing differently using Quirks Mode, you see, so forcing the Browser into Standards Compliance Mode is critical.

It is diffucult enough to obtain Cross Browser compatability with a DTD, and more difficult without one.
Go to the top of the page
 
+Quote Post
Vyoma
post Nov 1 2006, 09:47 AM
Post #5


Cosmic Overlord
Group Icon

Group: Members
Posts: 571
Joined: 26-November 05
From: Denver, Colorado, US
Member No.: 9,811
myCENTs:45.66


Up until now, I have been using a 'Transitional' DTD for all my webpages.

I heard it somewhere that W3C is suggesting everyone to use 'Strict' DTD. That way, the standardization of browsers would see the light of day.

But I find it a bit hard to actually stick to Strict DTD in some senarious where all the content is not under my control in dynaic senarios.
Go to the top of the page
 
+Quote Post
Chesso
post Nov 1 2006, 10:07 AM
Post #6


Teh Coder
Group Icon

Group: Members
Posts: 1,053
Joined: 18-April 06
From: Australia
Member No.: 12,833
myCENTs:89.25


That's right Vyoma, you can't get far without breaking the strict DTD.

But if your not going to teach someone what the purpose is of the DTD, it will only serve to confuse them.
Go to the top of the page
 
+Quote Post
saint-michael
post Nov 1 2006, 07:51 PM
Post #7


SM- the Man -The Myth - The Legend Himself
Group Icon

Group: Members
Posts: 477
Joined: 4-September 05
From: Drinking da rootbeers
Member No.: 8,313
myCENTs:61.67


QUOTE(FirefoxRocks @ Oct 30 2006, 06:47 PM) [snapback]90500[/snapback]

First of all, you should teach HTML, you should teach XHTML.

Second of all, y did you put yoru tutorial in quotes?


Actually it best to start off with the 4.01 just to get a basic understanding of it. Then once someone gets a good understanding of html then move on to xhtml.


Agree with that you seldom find any strict xhtml sites, well at least I haven't, just because of how hard it is to keep it within those properties. I have seen some good templates using the strict DTD format.
Go to the top of the page
 
+Quote Post
Chesso
post Nov 1 2006, 11:58 PM
Post #8


Teh Coder
Group Icon

Group: Members
Posts: 1,053
Joined: 18-April 06
From: Australia
Member No.: 12,833
myCENTs:89.25


And when you bring PHP and Database into the score of things it's near impossible heh heh.

But if your going to include a DTD at all, there should be atleast a basic explanation as to what purpose it serves, to help save on confusion.
Go to the top of the page
 
+Quote Post
aggie
post Nov 10 2006, 04:05 AM
Post #9


Newbie [ Level 1 ]
Group Icon

Group: Members
Posts: 4
Joined: 30-October 06
Member No.: 16,866


QUOTE(FirefoxRocks @ Oct 30 2006, 05:47 PM) [snapback]90500[/snapback]

First of all, you should teach HTML, you should teach XHTML.

Second of all, y did you put yoru tutorial in quotes?

yea its cause you cant put tut's from trap17 onto asta without them. but thanks for the compliments everyone. and beginners should learn the basics of both.
Go to the top of the page
 
+Quote Post
borlafu
post Nov 10 2006, 08:17 PM
Post #10


Member [ Level 2 ]
Group Icon

Group: Members
Posts: 58
Joined: 9-November 06
Member No.: 17,133


Begginners should learn XHTML, the strincter the better.

HTML is wrongly designed from the beginning, it only makes new designers get cofused.

XHTML is properly standardized, and is compatible with XML.

The idea is to separate the CONTENT from the DESIGN and that is what XHTML + CSS is all about.
Go to the top of the page
 
+Quote Post

Reply to this topicNew Topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Collapse

> Similar Topics

    Topic Title Replies Topic Starter Views Last Action
No new   27 firefoxsilver9 31,649 5th March 2010 - 03:36 AM
Last post by: iG-Vivek Lohia
No New Posts   12 Zeeshan Hashmi 5,198 15th February 2010 - 09:59 PM
Last post by: iG-thewind
No New Posts   3 FirefoxRocks 274 14th February 2010 - 03:52 AM
Last post by: mastercomputers
No New Posts   6 Eggie 1,532 10th February 2010 - 01:29 AM
Last post by: iG-james
No New Posts   12 Nqon 4,613 9th February 2010 - 02:46 PM
Last post by: iG-
No New Posts  
5 PHP
9 vujsa 3,063 12th January 2010 - 08:55 PM
Last post by: iG-
No New Posts   8 starscream 383 4th January 2010 - 11:08 AM
Last post by: starscream
No New Posts   10 Ploforia 1,940 19th December 2009 - 11:13 AM
Last post by: iG-Jeremy John
No new 28 HTML_Guru 5,092 8th December 2009 - 10:43 PM
Last post by: HannahI
No New Posts   3 turbopowerdmaxsteel 593 3rd December 2009 - 02:00 PM
Last post by: takerraj
No New Posts   3 suicide 4,323 27th November 2009 - 04:05 AM
Last post by: iG-satish
No New Posts   17 proxies 2,750 4th November 2009 - 11:29 PM
Last post by: HannahI
No New Posts 12 Propeng 3,511 3rd November 2009 - 09:55 PM
Last post by: HannahI
No New Posts   0 fermin25 139 22nd October 2009 - 07:00 PM
Last post by: fermin25
No new   23 sandeep 7,997 12th October 2009 - 10:35 AM
Last post by: iG-benivolent


Web Hosting Powered by ComputingHost.com.
HONESTY ROCKS! truth rules.
Creative Commons License