/    Sign up×
Community /Pin to ProfileBookmark

Ok, Im new to CSS, I think I created my first stylesheet, little help though

Ok, so here is what I have so far. I am trying to do my first web page mostly in CSS by hand, and Im having trouble.

What I am trying to do is setup my fixed background first. Then I want to create the main cell that will hold the website in the middle of the screen. So far I have not been able to do both.

Questions:

Lets say the main structure of the website will be inside the “mainCell”. So I set the properties for it, great. But what do I do next. I need to actually create the cell, but not sure how now.

Also, let say I want to assign a rollover link property to my new main cell (which I havent created yet). Do I simply just say <div mainCell.a:hover> or something to that effect?

Thanks

Here is what it looks like now:

[QUOTE]

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd“>
<html xmlns=”http://www.w3.org/1999/xhtml“>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″ />
<title>New CSS webpage/title>
<style type=”text/css”>
body,td,th {
font-family: Arial, Helvetica, sans-serif;
font-size: 10px;
color: #666666;
margin: 0;
}
mainCell {
font-family: Arial, Helvetica, sans-serif;
font-size: 10px;
color: #666666;
background-image: url(backgroundJPG.jpg)
background-attachment: fixed;
background-position: top center;
margin: 0;
background-color: #000000;

}
body {
background-color: #000000;
background-image: url();
opacity: 0.5;
}
a {
font-family: Arial, Helvetica, sans-serif;
font-size: 10px;
color: #FF0000;
}
a:link {
text-decoration: none;
}
a:visited {
text-decoration: none;
color: #FF0000;
}
a:hover {
text-decoration: none;
color: #FFFFFF;
}
a:active {
text-decoration: none;
color: #FF0000;
}
</style>
<body>
</html>

[/QUOTE]

to post a comment
CSS

1 Comments(s)

Copy linkTweet thisAlerts:
@CharlesApr 08.2009 — You've put the cart before the horse and it's much easier to develope the styles when you have the HTML down. So start with some content in valid HTML 4.01 strict. You don't want to be using XHTML but you do want to be using the Strict doctype.

To target a particular element you want to use an ID selector. See http://www.w3.org/TR/CSS2/selector.html#id-selectors .
×

Success!

Help @BlackReefDesign spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.2,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,
)...