The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> My CSS does not working
sajox
post 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>
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Jul 1 2020, 02:25 PM
Post #2


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,716
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. wink.gif
https://jigsaw.w3.org/css-validator/
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
sajox
post Jul 1 2020, 02:28 PM
Post #3





Group: Members
Posts: 9
Joined: 16-June 20
Member No.: 27,402



QUOTE(pandy @ Jul 1 2020, 09:25 PM) *

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 biggrin.gif

This post has been edited by sajox: Jul 1 2020, 02:31 PM
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Jul 1 2020, 02:30 PM
Post #4


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,716
Joined: 9-August 06
Member No.: 6



Yes, it works. Maybe you removed something more? Let's see.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Jul 1 2020, 02:32 PM
Post #5


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,716
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.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
sajox
post Jul 1 2020, 02:34 PM
Post #6





Group: Members
Posts: 9
Joined: 16-June 20
Member No.: 27,402



QUOTE(pandy @ Jul 1 2020, 09:32 PM) *

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.



Hahahahaha so stupid mistake. Thank you very much. You are the best.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Jul 1 2020, 02:35 PM
Post #7


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,716
Joined: 9-August 06
Member No.: 6



QUOTE(sajox @ Jul 1 2020, 09:34 PM) *

Hahahahaha so stupid mistake. Thank you very much. You are the best.


I know. cool.gif laugh.gif
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Jul 1 2020, 02:37 PM
Post #8


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,716
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. happy.gif
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Jul 1 2020, 02:38 PM
Post #9


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,716
Joined: 9-August 06
Member No.: 6



QUOTE
Okay I will try with the validator. Thanks a lot biggrin.gif


Oh, you did read it. Oh well, can't be said often enough. tongue.gif
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 28th March 2024 - 09:38 AM