What's new
HTML Forums | An HTML and CSS Coding Community

Welcome to HTMLForums; home of web development discussion! Please sign in or register your free account to get involved. Once registered you will be able to connect with other members, send and receive private messages, reply to topics and create your very own. Our registration process is hassle-free and takes no time at all!

HTML and External CSS Not Working

Ahr Aitch

New member
I have a couple of short files listed below. The HTML file attemptt to define a class called .mastheadDiv within Div tags and to invoke a style for the text within the Div tags using CSS contained in an external file. I had this working until I changed the CSS file making an error. I deleted the change, but the code still doesn't do what I want. The text in the Div should appear in an area bounded by a doule border with a tan background and text color in brown.

I composed in VS Code. All the files are in a folder. That folder contains subfolders that will contain images, scripts and styles. The CSS file (mastheadDiv.css) resides in the styles subfolder. The html file (newHTML.html) resides in the top, project folder.

The problem(s) might exist in the HTML or in the CSS; I don't know. I tried to keep the code simple as I'm only beginning to learn to code HTML and CSS. There might be problems in the strucdture or syntax of either or both files.

I've looked at this for so long I cannot see it freshly in order to spot my problem. Any help would be appreciated.

HTML file (newHTML.html)
```
<!DOCTYPE html>
<html>
<head>
<title>
527 Clan
</title>
<link
rel="stylesheet"
href="Styles/mastheadDiv.css">

<div class="mastheadDiv">
The Hutchins Clan
</div>
<script>
</script>
</body>
</html>
```

CSS file (mastheadDiv.css)
```
.mastheadDiv {
border: 5px outset rgb(64, 1, 1);
border-style: double;
background-color: rgb(237, 228, 215);
text-align: center;
color: rgb(168, 26, 26);
}
```

ps: If there is a tool or convention for showing code samples that I should use, please tell me.
 
Back
Top