HTML5 & CSS3 the deep end - Page 4 -...

User 184085 Photo


Ambassador
1,707 posts

Hi Ken, OK lets try this

Your page starts off like this: (your can be more specific to your needs

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="generator" content="CoffeeCup HTML Editor (www.coffeecup.com)">
<meta name="created" content="Mon, 26 Jul 2010 21:13:19 GMT">
<meta name="author" content="David Wilson" />
<meta name="description" content="">
<meta name="keywords" content="">
<meta name="revised" content="" />
<link rel="stylesheet" href="css/reset.css" type="text/css" media="screen" charset="utf-8" />
<link rel="stylesheet" href="css/css3styles.css" type="text/css" media="screen" charset="utf-8" />
<!--[if IE]>
<link rel="stylesheet" href="css/styles.css" type="text/css" media="screen" charset="utf-8" />
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<title></title>
<style type="text/css">

</style>

</head>

Now you have 2 choices, you have the linked css file or the section between the <style></style> tags, my preference is to go between the tags because i can rapidly make changes until I get the effect i want, then move the code into the css file.

So now onto the background, for the site we want a complete background for the page, so the <body> tag seems good.

so between the style and /style tag i put:

body {background-image:url('images/background.png'); }

this will take the graphic in the images folder background.png and start tilling it across as well as down the page.

if i just wanted to to go across the top i would add one more thing:

body {background-image:url('images/background.png'); background-repeat:repeat-x; }

if i wanted it just to go down the left side of the page i would change the x to a y

body {background-image:url('images/background.png'); background-repeat:repeat-y; }

if i didn't want it to tile at all, just one image

body {background-image:url('images/background.png'); background-repeat:no-repeat; }

:)
Volunteering to help :)
http://www.tbaygeek.ca
My HTML play area
http://www.tbaygeek.ca/test/
User 38401 Photo


Senior Advisor
10,951 posts

Hiya Kenneth,

Not sure if you're talking HTML in general or HTML5, but I do think that david is talking about html5 here in his response to you. Your post sounds general like HTML at all rather than specific version, might want to clarify that for david so he and the rest of us know if you need general help or HTML5 help :)
User 184085 Photo


Ambassador
1,707 posts

Just a little housecleaning today;

the old code:
<link rel="stylesheet" href="css/reset.css" type="text/css" media="screen" />
<link rel="stylesheet" href="css/css2styles.css" type="text/css" media="screen" />
<link rel="stylesheet" href="menu/css/vifc-menu.css" type="text/css" media="screen" />
<link rel="stylesheet" href="css/css3styles.css" type="text/css" media="screen" />


got changed to:
<link rel="stylesheet" href="css/styles.css" type="text/css" media="screen" />


then the styles css is :
@import url("reset.css");
@import url("css2styles.css");
@import url("../menu/css/vifc-menu.css");
@import url("css3styles.css");


this will pay dividends as the site grows in size :)
Volunteering to help :)
http://www.tbaygeek.ca
My HTML play area
http://www.tbaygeek.ca/test/
User 184085 Photo


Ambassador
1,707 posts

thats css2styles.css not css2stypes.css :)
Volunteering to help :)
http://www.tbaygeek.ca
My HTML play area
http://www.tbaygeek.ca/test/
User 122279 Photo


Senior Advisor
14,456 posts

I corrected it for you :)
Ha en riktig god dag!
Inger, Norway

My work in progress:
Components for Site Designer and the HTML Editor: https://mock-up.coffeecup.com


User 184085 Photo


Ambassador
1,707 posts

Inger Eik wrote:
I corrected it for you :)


Why thank you :)
Volunteering to help :)
http://www.tbaygeek.ca
My HTML play area
http://www.tbaygeek.ca/test/
User 184085 Photo


Ambassador
1,707 posts

User 184085 Photo


Ambassador
1,707 posts

Well I am about half way through the site and as a comparison, I put the identical pages up against each other, one XHTML and the other HTML5

here are the results,
http://i130.photobucket.com/albums/p248/pug2775/coffeecup/coffee-13.jpg

small on disk file size, and a significant drop in the number of lines needed to render the page, and the pages look better also :)

new page http://dev.flyvifc.org/about_us.php

old page flyvifc.org/v2_0/aboutus.shtml
Volunteering to help :)
http://www.tbaygeek.ca
My HTML play area
http://www.tbaygeek.ca/test/
User 38401 Photo


Senior Advisor
10,951 posts

Your first link to the dev.fly... doesn't work david, just so you're aware :)
User 184085 Photo


Ambassador
1,707 posts


Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.