HomeRegisterLog in

Share | 

 *Actual* HTML

Go down 

Posts : 2
Rep : 0
Join date : 2012-02-13

PostSubject: *Actual* HTML   Sat Feb 18, 2012 3:33 am

I’ve been reading this section recently and I noticed just how flawed some of the topics are, especially about HTML.

It’s really hard for me as a developer to see people instructing others incorrectly, so I’m going to post a few corrections.

Let’s start.

Simple HTML by Desu
<body bgcolor="#000000"> </body>
WRONG! There are two body tags which isn’t correct. Imagine your head having two noses and four nostrils!
Furthermore, background colour can and SHOULD be done via CSS.
And there, mistakes don’t end! EVERY HTML page should have a doctype. Old browsers, such as older versions of Internet Explorer, will otherwise not display the page correctly. And it has to have a doctype to be valid HTML. We’ll use HTML 4.1 Strict as an example.

So the correct way to have this code would be something like this:
<title>*Page title*</title>
<style type="text/css">body { background-color:#000000; color:#FFFFFF }</style>
<body>Page contents</body>
Note that I also added color:#FFFFFF; to the CSS because black (default colour) text wouldn’t be visible on black background.

Anyone Know Html (reply by Apocalypse)
<title>YOUR TITLE HERE</title>
Again, the HEADER HERE is incorrect. The head tag should contain links to CSS (link rel), CSS (style), title, META tags etc. Body should contain everything that’s visible to a regular viewer, for example:
<!DOCTYPE html>
<title>YOUR TITLE HERE</title>
<meta robots="noindex,nofollow" />
<link rel="stylesheet" type="text/css" href="/style.css" />
<link rel="icon" type="image/png" href="/favicon.png" />
<body><table><tr><td><a href="/"><img src="/header.jpg" /></a></td></tr>
<tr><td><a href="/">Index</a> | <a href="/memberlist">Memberlist</a></td></tr>
<tr><td>BODY OF PAGE HERE</td></tr></table>
Please note that TABLES should not be used for styling the page, but I did it anyway to make it easier to understand and because we don’t know what’s defined in the CSS and what isn’t.
Again, a DOCTYPE is required. I used the HTML5 doctype here, however HTML5 is still experimental, so it isn’t recommended to use it.

And last but not least:
{HTML} Font size by Desu
Quote :
Set the size of your font with size. The range of accepted values is from 1(smallest) to 7(largest).The default size of a font is 3.

<font size="5">Here is a size 5 font</font>

  1. The range of accepted values is from 1 (smallest) to 7 (largest). - Really? By default, if no type of measurement is specified, the unit is em. You can also specify % (percentage) OR pixels (px).
  2. Code:
    <font size="5">...</font>
    The font tag has been deprecated for as long as I remember. Here is an old article I found on WWWC: Forget font, use CSS.

The correct way of specifying font size would be:
<p style="font-size:15px">15 pixels</p>
<p style="font-size:150%">150% of the default size</p>
<p style="font-size:10em">10 em</p>
<p style="font-size:12pt">12 pt</p>
OR via the style tag:
<!DOCTYPE html>
<html><head><title>...</title><style type="text/css">p { font-size:10px; }</style></head>
<body><p>10 pixels</p></body></html>

If any of you have any questions , feel free to leave them as a reply Smile

independent web designer and PHP developer

Edit: I have also taken the privilege to add black background to the post via the CSS in the Administrator panel. The text was hard to read because of the background image. Wink
Back to top Go down

Posts : 306
Rep : 10
Join date : 2010-09-30
Age : 24
Location : Indio CA

PostSubject: Re: *Actual* HTML   Mon Feb 20, 2012 1:18 pm

Smart Cookie! haha, thx for the legitimate info bro! ;D


Back to top Go down
*Actual* HTML
Back to top 
Page 1 of 1
 Similar topics
» SAMBUCA 11 Ctg New
» Complete quest map & item list
» Rate the player above you
» Tilesets
» Disable Copy/Paste into HTML form using Javascript

Permissions in this forum:You cannot reply to topics in this forum
 :: Technology and Software :: Programming-
Jump to:  
Create a forum on Forumotion | © phpBB | Free forum support | Contact | Report an abuse | Forumotion.com