Linking HTML with CSS for formatting

qa-featured

I happen to be learning HTML coding for basis web design. I know how to implement the html codes but poor at CSS especially linking it to html. I have a simple web page and a separate style sheet I want to link it to. Someone to help me.

SHARE
Best Answer by Brian_Erick
Best Answer
Best Answer
Answered By 0 points N/A #87500

Linking HTML with CSS for formatting

qa-featured

It is tricky however simple. Go to 'In between head tags in your html' and place the following coding;

<style>
<link rel="stylesheet" type=" text/css" href="yourcss.css" >
</style>

and call it where you want to apply it by,  for instance in a division, adding 'class=yourcss'

<div class="yourcss">

</div>

Where yourcss.ss is the name of your css document with css extension placed in the same directory as the web page. Save and reload your web page.

Answered By 0 points N/A #87501

Linking HTML with CSS for formatting

qa-featured

Create css  document using any word processor especially note pad and save it as name.css (I mean with css extension). e.g. css to format the body would appear as follows:

                  .background:rgba(12,12,12,0.75);color:orange;

Save it as body.css in the same directory root as the web page. In your already created web page, but the head tags, place the following code:

<style>
<link rel="stylesheet" type=" text/css" href="body.css" >
</style>

Still in your web page, go to the body section(opening body tag) in this case to format the body and place the following code call the formatting properties of the css it is linked to:

<body class="body">

Save the changes in both your docs and trying reloading the pages, it will work.

Login/Register to Answer

Related Questions