user3997886
user3997886

Reputation:

Header and navigation aren't at the same line (CSS)

I just started learning HTML and CSS from one guy tutorials and I have a problem. I want that my navigation and heading would be at one line, but when I type display: inline; it doesn't do anything.

Here's the photo:

enter image description here

My HTML and CSS: http://pastebin.com/uZunJFr7

Any help?

Upvotes: 0

Views: 87

Answers (2)

Sidd
Sidd

Reputation: 1397

You are setting rules for nav ul instead of nav, which is the sibling of h1 in your code, and is the one that needs to line up with it. Also, use inline-block instead of inline.

Working fiddle: http://jsfiddle.net/fzhg4cof/

Upvotes: 1

deowk
deowk

Reputation: 4318

do this:

header h1 {
        margin: 0;
        float: left;
}

heres a fiddle --> https://jsfiddle.net/dnqxLwkp/

Upvotes: 1

Related Questions