Jump to content

style not applied?


Recommended Posts

i have this html code:

<!DOCTYPE html>
<html lang="en">

	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<meta http-equiv="X-UA-Compatible" content="ie=edge">

	<link rel="stylesheet" type="text/css" href="styles.css">

		<h1>Commands Documentation</h1>

		<div class="all-commands">
			<div class="command" id="open">
				<dl class="description">
					<dd>the syntax of the command
						<i>param1</i> param2


and this is styles.css:

dt {
	color: red;
	font-weight: bold

the css isn't applied to <dt> elements, any idea why?

Link to comment
Share on other sites

None of those should cause any problems at all? the <br> within dl element is not allowed, only within the dt, dd elements.

1) what editor are you using? if notepad, make sure you save as UTF-8 encoded, and make sure your files are saved as test.html and not test.html.txt or style.css.txt. If your O/S hide extensions, all you will see is test.html, but really its test.html.txt

2) Make sure you use a localhost server, and not just from opening the file from O/S file system folder into a browser.

3) Make sure you clear history or cache after each change, try Ctrl F5.

4) Make sure you end each property with semi-colon ';'

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...