My CSS does not working |
My CSS does not working |
sajox |
Jul 1 2020, 02:21 PM
Post
#1
|
Group: Members Posts: 9 Joined: 16-June 20 Member No.: 27,402 |
Hello everybody. I have little practice with HTML and CSS. Here is problem. My CSS does not working in Edge and Chrome and other browsers.
I wrote it in Visual Studio Code. This happens to me sometimes but I don’t know why. I think the code is written correct. Does anyone know what the problem is? Your help would mean a lot to me. Here is my code. <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width:device-width, intial-scale:1"> <style type="text/css"> #div2{width:30%; border: 3px solid black; background:yellow; color:blue; margin: 50px, 60px, 50x, 50px; padding: 10px; } </style> </head> <body> <div id="div2"> This is text </div> <div> This is another line of text</div> </body> </html> |
pandy |
Jul 1 2020, 02:25 PM
Post
#2
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,730 Joined: 9-August 06 Member No.: 6 |
The margins, you mean? That's because of the commas. It should be a space separated list.
CODE margin: 50px 60px 50x 50px; The validator would have told you. Use it. It will save you time and keep the headache away. https://jigsaw.w3.org/css-validator/ |
sajox |
Jul 1 2020, 02:28 PM
Post
#3
|
Group: Members Posts: 9 Joined: 16-June 20 Member No.: 27,402 |
The margins, you mean? That's because of the commas. It should be a space separated list. CODE margin: 50px 60px 50x 50px; I removed commas but it still does not working. Okay I will try with the validator. Thanks a lot This post has been edited by sajox: Jul 1 2020, 02:31 PM |
pandy |
Jul 1 2020, 02:30 PM
Post
#4
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,730 Joined: 9-August 06 Member No.: 6 |
Yes, it works. Maybe you removed something more? Let's see.
|
pandy |
Jul 1 2020, 02:32 PM
Post
#5
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,730 Joined: 9-August 06 Member No.: 6 |
Oops! You also had typed 50x instead of 50px in one place. I thought it was I that deleted the p by mistake when I removed the commas.
|
sajox |
Jul 1 2020, 02:34 PM
Post
#6
|
Group: Members Posts: 9 Joined: 16-June 20 Member No.: 27,402 |
|
pandy |
Jul 1 2020, 02:35 PM
Post
#7
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,730 Joined: 9-August 06 Member No.: 6 |
|
pandy |
Jul 1 2020, 02:37 PM
Post
#8
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,730 Joined: 9-August 06 Member No.: 6 |
Also, I edited my post above and added a link to the CSS validator, but you were quicker and had already answered, so maybe you didn't read that bit. Use the validator. It pays off, I promise.
|
pandy |
Jul 1 2020, 02:38 PM
Post
#9
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,730 Joined: 9-August 06 Member No.: 6 |
QUOTE Okay I will try with the validator. Thanks a lot Oh, you did read it. Oh well, can't be said often enough. |
Lo-Fi Version | Time is now: 25th April 2024 - 07:08 AM |