Linking css files to html


#1

this is my head code:
< !Doctype html>
< meta name="viewport" content="width=device-width, initial scale=1">
Dave's Logo Designs< /title>
< head>
< link rel="stylesheet" type="text/css" href="dld2.css"/>
< /head>
< body>

My css sheet is NOT loading at all. I don't know what I'm doing wrong.


#2

this is outside of codecademy? are the css and html file in the same directory?


#3

Codecademy doesn't support creating new CSS pages, and <!DOCTYPE html> should be capitalized accordingly. Also, why are all your tags floating?
You have:

< head>

Correct:

<head>

#4

yes, it is from outside.

the file is exactly the same


#5

I put a space to load the links right


#6

same directory and the file is called dld2.css? can i see a screenshot of the directory? And the content of the css file?


#7

how do I create a screenshot?


#8

the prtsc (print screen) button on your keyboard? You use windows? by default, this will mean it is on your clipboard, open paint, and press ctrl + v (paste), then save the paint, then upload it here


#9

What? That isn't needed, they should load fine?


#10

yea, if you use format like so:

<p>i am fine</p>

but if you don't use format, and no spaces:

i am not fine


(yes, i did put paragraph tags around that text). So, if you don't know how to format, you could this space trick (with the spaces after <)


#11


#12

I don't understand. The space just hurts my eyes.


#13

why do you have colons after your css selectors? h1: should be h1, same for the rest

@cadecodes, well, i put two paragraphs in my previous answer (one you saw because i use format/indentation), the other you did not (i didn't use indentation). So if you don't know how to indent/format, you can use the spaces to make it sow:
< p >i show< /p > (spaces)
<p>i show</p> (indent/format)

i do not show

(nothing, it is invisible, there are really <p></p> tags in this line
that are 3 paragraphs (you only see 2)

#14

@stetim94, So there is no difference?


#15

you should remove all the spaces if you want to run the code, the spaces are only to make the code show on the forum


#16

the html text shows fine in run... the only thing not working is the external css sheet.


#17

@objectplayer08304, ignore @cadecodes, i will explain this to him (cadecodes) a messages, since it is not relevant to the discussion. Did you remove the colons after the css selectors like i said?


#18

yes, and still nothing.


#19

can you copy your css code to the forum so i can run it?


#20

/* CSS Document */
body {
background-image: 'http://postimg.org/image/qtyc3pehb/';
background-repeat: none;
}
h1 {
position: fixed-left;
color: black;
text-size: 30px;
background-color: transparent;
border-top: 1px;
border-bottom: 1px;
border-left: 1px;
border-right: 1px;
padding: 0px;
margin: 4px;

}
p {
color: black;
background-color: transparent;
text-position: fixed-left;
padding: 0px;
margin: 4px;

}
.menu {
position: fixed-left;
padding: 0px;
margin: 0px;
width: device-width;
background-color: blue;
text-align: center;
text-size: 18px;
text-weight: bold;
color: white;
}

}