3. Controlling HTML with CSS Flashcards
Allow you to separate your content from its presentation
Cascading Style sheets
CSS
Handles the content of web browsers
HTML
One way to incorporate CSS code is to save all of your markup to file using the
.css extension that accessible to your .html files
Another way to use CSS is to add it between <style> tags within this section of your HTML</style>
<head>
</head>
Tag uses the stylesheet attribute and points to a CSS file called main.css thats in the web root directory on this server
rel
paragraph
p
element will be applied through the id=attribute
special
targets elements with a class
.highlight
targets elements based on relationship
list-style-type: square;
target elements based on attribute values
input[type=”text’] {
border: 1px solid gray;
classes are not traditional classes but class controls
pseudo class.
normal at-rest appearance of a button my have
blue background
white text
hovering will cause the background to
turn light blue
mechanism that allows properties defined on parent elements to be inherited by their chiled elements
when property is set on a parent element its value is automatically inherited by its descendents unless overridden.
CSS Inheritance
HTML exists within this that uses the id=attribute to adopt the parent style
<div>
</div>
html style attribute overrides css rules in style tag and css file
Inline css
takes precedence over a less specific one
more specific selector