0

I'm having some weird trouble with my css, It doesn't load!? So I'm using google chrome to preview it on and it always had worked fine, until I started to ad meta tags. This is the code that I'm using;

body {
    margin: 0;
    overflow: hidden;
}

mainContainer {
    position: absolute;
    width: 100%;
    height: 600px;
    background-color: black;
}
<DOCTYPE! html>
<html>
<head>
    <title>Sander™ - Code & Design</title>
    <link href="stylehome.css" type="text/css" rel="stylesheet">
    <meta name="description" content="Welcome to my website - Sander™ - Code & Design">
    <meta name="author" content="Sander™ - Code & Design">
    <meta name="keywords" content="Minecraft Server, RPG, Nederlands, 24/7, Beste Minecraft Server, NL server">
    <script src="http://code.jquery.com/jquery-latest.min.js"></script>
    <script src="https://code.jquery.com/ui/1.11.3/jquery-ui.min.js"></script>
    <script src="javaScript.js"></script>
</head>
<body>
    <div id="mainContainer">
    
    </div>
</body>
</html>

And I don't know why it's not previewing, I can't find any spell mistakes, and overall I always had done it this way (only not the meta tags) and I always worked fine. So if somebody can spot something wrong please tell me.

Thanks in Advance!

1
  • #mainContainer { ... } instead of mainContainer {...} Commented Sep 16, 2015 at 18:36

1 Answer 1

3

mainContainer is a type selector that matches all <mainContainer> elements, which you don't have any of and aren't allowed in HTML anyway.

You need an ID selector, which starts with a # character.

Sign up to request clarification or add additional context in comments.

1 Comment

Okey I'm a bit schocked that I missed that, But thank u somuch for the fast response

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.