100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
CSS Basics Questions and Answers $12.99   Add to cart

Exam (elaborations)

CSS Basics Questions and Answers

 6 views  0 purchase
  • Course
  • Pcss
  • Institution
  • Pcss

CSS Basics Questions and Answers CSS CSS (which stands for Cascading Style Sheets) is a language used to describe the appearance and formatting of your HTML. A style sheet is a file that describes how an HTML file should look. We say these style sheets are cascading because the sheets can a...

[Show more]

Preview 2 out of 9  pages

  • November 24, 2024
  • 9
  • 2024/2025
  • Exam (elaborations)
  • Questions & answers
  • Pcss
  • Pcss
avatar-seller
Pogba119
CSS Basics Questions and Answers
CSS - answer CSS (which stands for Cascading Style Sheets) is a language used to
describe the appearance and formatting of your HTML.

A style sheet is a file that describes how an HTML file should look.

We say these style sheets are cascading because the sheets can apply formatting
when more than one style applies. For instance, if you say all paragraphs should have
blue font, but you specifically single out one paragraph to have red font, CSS can do
that!

Ex)
p{
color: red;
}

span {
color: blue;
}

CSS Syntax (Rule Set, Declaration, Selector, Property, Value) - answer General
format:

selector {
property: value;
}

A rule set is made up of a selector and 1 or more declarations.

A declaration is made up of a property and a value (property-value pair). Declarations
are enclosed in curly brackets and separated by semicolons.

A selector allows you to select and manipulate HTML elements. 1 or more elements can
be "selected" at once for styling using the elements themselves, nesting position,
attributes (including id and class) and even values. Any HTML element can be a
selector.

A property is an aspect of a selector (it's like an attribute for html). They are the different
styling options. For instance, you can change the font-family, color, and font-size of the
text on your web pages .

A value is a possible setting for a property. Ex) color can be red, blue, black, or almost
any color.

, *You need to end each property-value with a semi-colon (;). That's how CSS knows
you're done with one pair and ready for the next.

Why separate form (CSS) and function (HTML)? - answer There are two main
reasons for separating your form/formatting (CSS) from your functional content/structure
(HTML):

1. You can apply the same formatting to several HTML elements without rewriting code
(e.g. style="color:red":) over and over.

2. You can apply similar appearance and formatting to several HTML pages from a
single CSS file.

Using Style Tag - answer There are two ways to implement CSS. This first is to put
your CSS between <style></style> tags, right in the same file as your HTML. These
<style> tags go inside the <head></head> of your webpage.

Ex)
<head>
<style>
p{
color: purple;
}
</style>
<title>Result</title>
</head>

Using Link Tag - answer The second way to implement CSS is to write your CSS in
a separate file. You do this by putting a <link /> tag (as you saw in the first exercise of
this course) between the <head>...</head> tags of your HTML page. Your <link /> tag
needs three attributes:

1. A type attribute that should always be equal to "text/css".
2. A rel attribute that should always be equal to "stylesheet".
3. A href attribute that should point to the web address of your CSS file.

Ex) <link type="text/css" rel="stylesheet" href="styles.css" />

Comments - answer CSS comments look different from HTML comments, but you
still use them as a way to explain why you did something a certain way in your code.

Ex) / * I'm a comment! * /

Hexadecimal Values (colors) - answer This is the system used by CSS to identify
colors. Hexadecimal counting is base-16 (each digit has 16 possibilities). Each digit can

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller Pogba119. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $12.99. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

62890 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$12.99
  • (0)
  Add to cart