The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> CSS, CSS coding
deb1
post Jun 29 2020, 01:03 AM
Post #1


Advanced Member
****

Group: Members
Posts: 102
Joined: 7-May 20
Member No.: 27,330



Can you please answer a few questions for me regarding the coding below:
1) for the margin and padding does it have to be "0" or can it be any value?
2) the coding below it says that the overflow is hidden ... can it be anything or does it have to be hidden ?
3) the text-decoration says its none but can i put anything if i want to or does it have to be none?

<!DOCTYPE html>
<html>
<head>
<style>
ul {
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
background-color: #333;
}
li {
float: left;
}
li a {
display: block;
color: white;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
li a:hover {
background-color: #111;
}
</style>
</head>
<body>
<ul>
<li><a class="active" href="#home">Home</a></li>
<li><a href="#news">News</a></li>
<li><a href="#contact">Contact</a></li>
<li><a href="#about">About</a></li>
</ul>
</body>
</html>
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Jun 29 2020, 02:34 AM
Post #2


Computer says no.
********

Group: WDG Moderators
Posts: 18,955
Joined: 9-August 06
Member No.: 6



QUOTE(deb1 @ Jun 29 2020, 08:03 AM) *

1) for the margin and padding does it have to be "0" or can it be any value?


It can be whatever you want as long as you restrict yourself to the allowed unities units. I wouldn't use miles or km.

CSS3 may have added a little, but the CSS 2.1 spec is easier to read. so...
http://www.w3.org/TR/CSS21/box.html#propdef-margin
https://www.w3.org/TR/CSS21/box.html#propdef-padding


QUOTE
2) the coding below it says that the overflow is hidden ... can it be anything or does it have to be hidden ?


It can be any of the defined values.
https://www.w3.org/TR/CSS21/visufx.html#propdef-overflow


QUOTE
3) the text-decoration says its none but can i put anything if i want to or does it have to be none?


As above.
https://www.w3.org/TR/CSS21/text.html#propd...text-decoration


The property index is useful for looking things up.
https://www.w3.org/TR/CSS21/propidx.html
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
deb1
post Jun 29 2020, 08:40 AM
Post #3


Advanced Member
****

Group: Members
Posts: 102
Joined: 7-May 20
Member No.: 27,330



QUOTE(deb1 @ Jun 29 2020, 01:03 AM) *

Can you please answer a few questions for me regarding the coding below:
1) for the margin and padding does it have to be "0" or can it be any value?
2) the coding below it says that the overflow is hidden ... can it be anything or does it have to be hidden ?
3) the text-decoration says its none but can i put anything if i want to or does it have to be none?

<!DOCTYPE html>
<html>
<head>
<style>
ul {
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
background-color: #333;
}
li {
float: left;
}
li a {
display: block;
color: white;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
li a:hover {
background-color: #111;
}
</style>
</head>
<body>
<ul>
<li><a class="active" href="#home">Home</a></li>
<li><a href="#news">News</a></li>
<li><a href="#contact">Contact</a></li>
<li><a href="#about">About</a></li>
</ul>
</body>
</html>


For the first part of the question you said "as long as you restrict yourself to the allowed unities."
Can you please explain what you mean by that ... because i don't really understand that smile.gif
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Jun 29 2020, 09:05 AM
Post #4


Computer says no.
********

Group: WDG Moderators
Posts: 18,955
Joined: 9-August 06
Member No.: 6



My fingers slipped (corrected in my original post). I meant to write the allowed units. You find those if you click the link to the spec.
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: 3rd August 2020 - 04:36 PM