Question

Using examples, explain the three (3) main ways to applying styles to an HTML document.

Using examples, explain the three (3) main ways to applying styles to an HTML document.

Homework Answers

Answer #1

Using examples, explain the three (3) main ways to applying styles to an HTML document.

Explain the three (3) main ways to applying styles to an HTML document.

There are three ways to apply CSS to HTML: Inline, internal, and external.

Inline

Inline styles are plonked straight into the HTML tags using the style attribute.

They look something like this:


<p style="color: red">text</p>

This will make that specific paragraph red.

Internal

Embedded, or internal, styles are used for the whole page. Inside the head element, the style tags surround all of the styles for the page.


<!DOCTYPE html>
<html>
<head>
<title>CSS Example</title>
<style>

    p {
        color: red;
    }

    a {
        color: blue;
    }

</style>
...

This will make all of the paragraphs in the page red and all of the links blue.

Although preferable to soiling our HTML with inline presentation, it is similarly usually preferable to keep the HTML and the CSS files separate, and so we are left with our savior

External

External styles are used for the whole, multiple-page website. There is a separate CSS file, which will simply look something like:


p {
    color: red;
}

a {
    color: blue;
}

If this file is saved as “style.css” in the same directory as your HTML page then it can be linked to in the HTML like this:


<!DOCTYPE html>
<html>
<head>
    <title>CSS Example</title>
    <link rel="stylesheet" href="style.css">
...
Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Using examples from insects and crustaceans, explain, in addition, to biodiversity, THREE (3) different ways in...
Using examples from insects and crustaceans, explain, in addition, to biodiversity, THREE (3) different ways in which arthropods are regarded as a highly successful phylum?
Explain three main principles applying to stem cells by using the process of hemopoiesis. Principle 1...
Explain three main principles applying to stem cells by using the process of hemopoiesis. Principle 1 in stem cell biology - Principle 2 in stem cell biology - Principle 3 in stem cell biology -
1. explain with examples three main benefits of economic growth. 2. mention and explain causes of...
1. explain with examples three main benefits of economic growth. 2. mention and explain causes of economic growth. site references
Using specific examples, describe three different ways in which endocrine glands can be stimulated to release...
Using specific examples, describe three different ways in which endocrine glands can be stimulated to release their products.
Can you explain three ways that transcriptional repression can occur , please use some examples, thanks
Can you explain three ways that transcriptional repression can occur , please use some examples, thanks
List and explain three (3) examples of Lex Mercatoria.
List and explain three (3) examples of Lex Mercatoria.
Explain 3/three ways Masumoto practices ecological citizenship.
Explain 3/three ways Masumoto practices ecological citizenship.
1) Explain three ways that a firm that is considering entering an overseas market can use...
1) Explain three ways that a firm that is considering entering an overseas market can use market orientation to its advantage. 2)   Explain two reasons why culture may play a role in a company repositioning its brand when entering a foreign market 3) Explain how and why the two different thinking styles (analytic vs. holistic) can be applied differently to explain country-of-origin effects. 4) Explain three challenges that managers are likely to encounter when implementing value-based pricing and potential ways...
a) What is the main determinant of capital structure? b) Explain using examples from current events....
a) What is the main determinant of capital structure? b) Explain using examples from current events. C) In your answer can you include, if applicable, concepts of growth, profitability, firm leverage, PECKING order theory. asymmetric information, liquidity and or any other concept that is related in determining capital structure.  
Explain different ways of calling functions with appropriate examples In C++
Explain different ways of calling functions with appropriate examples In C++
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT