HTML & CSS- part 4 Flashcards
What are the usual measurements for borders, padding, and margins?
Borders are pixels
Padding and margins are EMs
If you want <h1> and <p> to share characteristics, what’s the best way to code that?
h1, p { characteristics to be shared }
If you group two element types together to give them the same characteristics, how does that affect the characteristics you don’t declare?
It doesn’t. Two grouped elements only share the traits you declare. You are still free to specify differences in other traits.
How is an ID different from a class?
An id is more exclusive.
It can be assigned only once in an HTML document.
And an element, though it can have many classes, can have only one ID.
Where a class uses a period right before the name, what does an ID use?
#
What a DIV?
A section of a web page. It behaves like any other element.
When might a coder use a DIV?
- headers
*navigation bars
*main content
*footers
How are DIVs formatted?
Usually each will have its own class or ID
How do you code a DIV?
<div>
</div>
Essentially the same as any other element, except it almost always has its own class or ID>
Why do some HTML tags need a closing tag while others don’t?
Generally, the ones that need a closing tag have content, like <h2> or <p>; the ones that don’t have a closing tag usually don’t have content (like <br></br>)
Why do some people write <br /> for a linke break or <hr /> for horizontal rule?
You used to have to write these tags like this if you didn’t have a closing tag, but you don’t have to do this anymore.
What is an attribute in HTML?
A little more info inside the tag to help the browser. So for <img> you would include the source, which is the attribute:
<img src=”wherever.jpg”>
What are the three main image types?
JPG, GIF, and PNG
What’s the JPG format best for?
The jpg format is best for photographs and for illustrations with many subtle colors.
What’s the GIF format best for?
*Usually just animation. Besides animation, PNGs do everything a GIF does better and with a smaller file
*It can be used for line drawings, illustrations with just a few colors, and images of text.
*offer transparency, meaning that the background color can show through wherever you want it to.