HTML/CSS Basics Flashcards
Attributes
HTML
Provides additional information about an element.
Ex: href src id
Tags
HTML Property
Brackets (<>) Surrounding an Element
<> Opening Tag
</> Closing Tag
HTML
HyperText Markup Language
Defines Structure of Content
CSS
Cascading Style Sheets
Represents Appearance of Content
Elements
Used in HTML
Define Structure
Ex: <h1>> <p> <div>
HTML Document Structure
All HTML documents have a required structure that includes the following declaration and elements: <!DOCTYPE html>, <html>, <head>, and <body>
Self-Closing Elements
Some elements simply receive their content or behavior from attributes within a single tag
Ex: <meta></meta> <img></img> <input></input> <link></link>
Selectors
CSS
A selector designates exactly which element or elements within our HTML to target and apply styles (such as color, size, and position) to.
Generally target an attribute value such as an id or class value.
Selectors are followed with curly brackets, {}, which encompass the styles to be applied to the selected element.
Properties
A property determines the styles that will be applied to that element.
ex: background color font-size height width padding
Values
Values determine the behavior of a property.
Values can be identified as the text between the colon, :, and semicolon, ;.
Type Selector
Type selectors target elements by their element type.
Should we wish to target all division elements, <div>, we would use a type selector of div.
Class Selector
Class selectors allow us to select an element based on the element’s class attribute value.
Class selectors allow us to apply the same styles to different elements at once by using the same class attribute value across multiple elements.
Within CSS, classes are denoted by a leading period, ., followed by the class attribute value
ID Selector
ID selectors are even more precise than class selectors, as they target only one unique element at a time. Just as class selectors use an element’s class attribute value as the selector, ID selectors use an element’s id attribute value as a selector.
Within CSS, ID selectors are denoted by a leading hash sign, #, followed by the id attribute value.
IDs can only be used one per page.
Syntax
Spelling and Gramar Rules
<p>
</p>
Paragraph Tag
<a></a>
Anchor Tag
<h1><h1>
...................
<h6></h6>
</h1></h1>
Heading Tag