You are viewing our Forum Archives. To view or take place in current topics click here.
HTML coding questions ...
Posted:
HTML coding questions ...Posted:
Status: Offline
Joined: May 29, 201410Year Member
Posts: 28
Reputation Power: 1
Status: Offline
Joined: May 29, 201410Year Member
Posts: 28
Reputation Power: 1
How can I link my index.html with my main.css file?
I have done <link rel="stylesheet" type="text/css" href="style/main.css"/> but it wont work?
What should I have in the main.css apart from stuff like body {
background:black;
}
Please help I 100% appreciate your help!
I have done <link rel="stylesheet" type="text/css" href="style/main.css"/> but it wont work?
What should I have in the main.css apart from stuff like body {
background:black;
}
Please help I 100% appreciate your help!
#2. Posted:
Status: Offline
Joined: Jun 10, 201014Year Member
Posts: 435
Reputation Power: 17
Status: Offline
Joined: Jun 10, 201014Year Member
Posts: 435
Reputation Power: 17
I have;
In my Code and it works fine, The code you need is;
Make Sure you Have a folder called "style" In the same place as "index.htm"
<link rel="stylesheet" href="css/style.css" />
In my Code and it works fine, The code you need is;
<link rel="stylesheet" href="style/main.css"/>
Make Sure you Have a folder called "style" In the same place as "index.htm"
- 0useful
- 0not useful
#3. Posted:
Status: Offline
Joined: May 29, 201410Year Member
Posts: 28
Reputation Power: 1
Status: Offline
Joined: May 29, 201410Year Member
Posts: 28
Reputation Power: 1
vJoeSwanson wrote I have;
<link rel="stylesheet" href="css/style.css" />
In my Code and it works fine, The code you need is;
<link rel="stylesheet" href="style/main.css"/>
Make Sure you Have a folder called "style" In the same place as "index.htm"
do i put man.css in the style folder
- 0useful
- 0not useful
#4. Posted:
Status: Offline
Joined: Jun 10, 201014Year Member
Posts: 435
Reputation Power: 17
Status: Offline
Joined: Jun 10, 201014Year Member
Posts: 435
Reputation Power: 17
nitro_portal wrotevJoeSwanson wrote I have;
<link rel="stylesheet" href="css/style.css" />
In my Code and it works fine, The code you need is;
<link rel="stylesheet" href="style/main.css"/>
Make Sure you Have a folder called "style" In the same place as "index.htm"
do i put man.css in the style folder
Yeah, then it should work.
- 0useful
- 0not useful
#5. Posted:
Status: Offline
Joined: May 29, 201410Year Member
Posts: 28
Reputation Power: 1
Status: Offline
Joined: May 29, 201410Year Member
Posts: 28
Reputation Power: 1
vJoeSwanson wrotenitro_portal wrotevJoeSwanson wrote I have;
<link rel="stylesheet" href="css/style.css" />
In my Code and it works fine, The code you need is;
<link rel="stylesheet" href="style/main.css"/>
Make Sure you Have a folder called "style" In the same place as "index.htm"
do i put man.css in the style folder
Yeah, then it should work.
it does not work so do you have skype?
- 0useful
- 1not useful
#6. Posted:
Status: Offline
Joined: Jun 25, 201014Year Member
Posts: 4,078
Reputation Power: 2628
Motto: https://www.thetechgame.com/Forums/t=7804 333/vote-for-tune-of-the-week-friday-nigh ts-lockdown-dj-sets.html
Motto: https://www.thetechgame.com/Forums/t=7804 333/vote-for-tune-of-the-week-friday-nigh ts-lockdown-dj-sets.html
Status: Offline
Joined: Jun 25, 201014Year Member
Posts: 4,078
Reputation Power: 2628
Motto: https://www.thetechgame.com/Forums/t=7804 333/vote-for-tune-of-the-week-friday-nigh ts-lockdown-dj-sets.html
Firstly, your code is wrong. You need to remove the ending "/"
So...
If it still does not work, follow these.
1) Make sure you have put it in the "head" tag and you close your head tag correctly.
2) Make sure your file structure is this
/
index.html
/style/
main.css
3) Make sure main is either lower or upper case in both ones
4) Make sure you close all correct tags
5) How are you testing to see if it works? Try inspect element then looking at the style sheet from in browser to see if it is linked correctly
So...
<head>
<link rel="stylesheet" type="text/css" href="/style/main.css">
</head>
If it still does not work, follow these.
1) Make sure you have put it in the "head" tag and you close your head tag correctly.
2) Make sure your file structure is this
/
index.html
/style/
main.css
3) Make sure main is either lower or upper case in both ones
4) Make sure you close all correct tags
5) How are you testing to see if it works? Try inspect element then looking at the style sheet from in browser to see if it is linked correctly
- 0useful
- 1not useful
#7. Posted:
Status: Offline
Joined: Apr 15, 201113Year Member
Posts: 614
Reputation Power: 83
Kyle93 wrote Firstly, your code is wrong. You need to remove the ending "/"
Unless the doctype declaration is stricly html4, the self closing tag isn't an issue.
- 2useful
- 0not useful
#8. Posted:
Status: Offline
Joined: Jun 25, 201014Year Member
Posts: 4,078
Reputation Power: 2628
Motto: https://www.thetechgame.com/Forums/t=7804 333/vote-for-tune-of-the-week-friday-nigh ts-lockdown-dj-sets.html
Motto: https://www.thetechgame.com/Forums/t=7804 333/vote-for-tune-of-the-week-friday-nigh ts-lockdown-dj-sets.html
Status: Offline
Joined: Jun 25, 201014Year Member
Posts: 4,078
Reputation Power: 2628
Motto: https://www.thetechgame.com/Forums/t=7804 333/vote-for-tune-of-the-week-friday-nigh ts-lockdown-dj-sets.html
iyop45 wroteKyle93 wrote Firstly, your code is wrong. You need to remove the ending "/"
Unless the doctype declaration is stricly html4, the self closing tag isn't an issue.
Completely correct, my apologies.
Only thing I'd note would be if he is having issues with linking a style sheet chances of him a) having a doctype or b) having a doctype thats going to cause problems, is quite high in my opinion.
- 1useful
- 0not useful
You are viewing our Forum Archives. To view or take place in current topics click here.