/    Sign up×
Community /Pin to ProfileBookmark

Problem with CSS updating

I have the following code saved in a CSS file

[code]
.box{
width: 1000px;
height: 1500px;
border: 5px solid black;
padding: 10px;
margin: 10px;
font-size: 40px;
}

.item1 {
padding: 15px;
width: 460;
height: 200px;
margin: 20px;
}

.item1, .item2 {
background-color: #E6C363
position: relative;
}

.item2 {
width: 460px;
height: 200px;
}

.item3 {
width: 960px;
height: 100;
}

.item4 {
width: 960px;
height: 400px;
}

.item5 {
width: 960px;
height: 400px;
}

.item6 {
width: 460px;
height: 700px;
}

.item7 {
width: 460px;
height: 300px;
}

.item8 {
width: 460px;
height: 200px;
}
[/code]

Saved in a CSS file is correct, yes? The wepage is called ‘website’ *see below*

In addition, I have the following code saved in an html file.

[code]
<!DOCTYPE html>
<html>
<head>
<title>My Website</title>
<meta name=”description”
content=”” />
<meta name=”keywords”
content=”” />
<meta http-equiv=”author”
content=”” />
<meta http-equiv=”pragma”
content=”no-cache” />
<link rel=”stylesheet” href=”css/website.css” />
</head>
<h1>This is my website</h1>
<body>
<div class=”box”>
<div class=”item1″>One</div>
<div class=”item2″>Two</div>
<div class=”item3″>Three</div>
<div class=”item4″>Four</div>
<div class=”item5″>Five</div>
<div class=”item6″>Six</div>
<div class=”item7″>Seven</div>
<div class=”item8″>Eight</div>
</div>
</body>
</html>
[/code]

I am getting nothing on the css end of this. I simply get the following:

This is my website

One
Two
Three
Four
Five
Six
Seven
Eight

What am I doing wrong?

to post a comment
CSS

2 Comments(s)

Copy linkTweet thisAlerts:
@tracknutNov 14.2022 — 
<link rel="stylesheet" href="css/website.css" />
[/quote]

This says that from wherever the html file is, there is a directory named "css", and that within that directory, you have a file called "website.css" with your css in it. Is that the layout and naming you've given the css file? If they are in the same directory, that link might look like below (i.e. no "css" directory).

<link rel="stylesheet" href="website.css">
[/quote]

By the way, you don't need the slash at the end. Also I note you have an <h1> element before <body>. It's unrelated to your css issue, but should be moved within the body.
Copy linkTweet thisAlerts:
@sibertNov 14.2022 — > @4539123#1648471 What am I doing wrong?

I recommend using JSFiddle to find errors and play with.

https://jsfiddle.net/tj2md0c4/
×

Success!

Help @4539123 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 4.23,
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: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

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