The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> CSS
deb1
post Jun 24 2020, 01:46 AM
Post #1


Advanced Member
****

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



i know there is one way we can use style sheet which is by linking the CSS document to html document. Also read that there is another way of doing the style sheet which is internal way
by using <style> tag in the html document .... is that correct or wrong? please let me know.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Jun 24 2020, 10:55 AM
Post #2


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

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



There are three ways. The two you mentioned and the one you've used before, the style attribute (not recommended other than for a quick fix).
https://htmlhelp.com/reference/css/style-html.html
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
deb1
post Jun 25 2020, 12:45 AM
Post #3


Advanced Member
****

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



which one you don't recomend?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
deb1
post Jun 25 2020, 12:56 AM
Post #4


Advanced Member
****

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



<!DOCTYPE html>
<html>
<head>
<style>
ul {
list-style-type: none;
margin: 0;
padding: 0;
}

li a {
display: block;
width: 60px;
background-color: #dddddd;
}
</style>
</head>
<body>

<ul>
<li><a 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>

<p>A background color is added to the links to show the link area.</p>
<p>Notice that the whole link area is clickable, not just the text.</p>

</body>
</html>


if i use the <style> like above .... will that be OK for CSS ?

User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Jun 25 2020, 08:42 AM
Post #5


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

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



QUOTE(deb1 @ Jun 25 2020, 07:45 AM) *

which one you don't recomend?


The style attribute.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Jun 25 2020, 08:43 AM
Post #6


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

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



QUOTE(deb1 @ Jun 25 2020, 07:56 AM) *

if i use the <style> like above .... will that be OK for CSS ?


Yes.
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: 29th March 2024 - 03:41 AM