i
What Do You Mean By HTML and CSS?
Common HTML Terms
Creating HTML Document Structure
Common CSS Terms
Selectors
Referencing CSS
CSS Resets
Getting to Know HTML And Semantics Overview
Identifying Divisions and Spans
Using Text Based Element
Building Structure
Creating Hyperlinks
Getting to Know CSS :The Cascade
Calculating Specificity
Combining Selectors
Layering Styles With Multiple Classes
Common CSS Properties
CSS Aural Media/Style Sheets
CSS Pagination
CSS Overflow
CSS White Space
CSS Word Wrap
CSS Outline
CSS Visibility
CSS Counters
CSS Animation
CSS Transition
CSS Tooltips
CSS Tooltip Animation
CSS Arrow
CSS Flexbox
CSS Media Queries
CSS 2D Transforms
CSS 3D Transforms
How are Elements Displayed?
Display Property Controls And Box Model?
Working With Box Model
Width and Height
Margins and Padding
Borders, Individual Border Sides, Border Radius, Box Sizing, Content Box and Padding Box
Developer Tools
Removing Spaces between Inline-Block Elements
Positioning With Floats
Floats in Practice
Positioning With Inline-Block
Clearing and Containing Floats
Creating Reusable Layouts
Uniquely Positioning Layouts
Adding Colour To Text
Changing Font Properties
Font Family
Font Size, Font Style, Font Variant, Font Weight And Line Height
Shorthand Font Properties
Applying Text Properties
Text Properties All Together
Using Web-Safe Fonts
Including Citation And Quotes
Adding A Background Colour
Adding a Background Image and Background Repeat
Background Position and Shorthand Background Image Values
Designing Gradient Backgrounds
Changing the Direction of a Gradient Background
Using Multiple Background Images
Exploring New Background Properties
Unordered Lists
Ordered Lists
Description Lists
Nested Lists
List Item Styling
List Style Type Values
List Style Position Property
Adding Media And Adding Images
Sizing Images
Positioning Images, Inline Positioning Images, Blocking Positioning Images , Positioning Images Flush Left or Right
Adding Audio
Adding Videos
Adding Inline Frames
Semantically Identifying Figures And Captions
Building Forms And Initializing a Form
Text Fields And Text Areas
Multiple Choice Inputs And Menus
Form Buttons
Other Inputs
Organizing Form Element
Form And Input Attributes
Login Form Example
Organizing Data with Tables
Creating A Table
Table Header
Table Structure
Table Head, Body and Foot
Combining Multiple Cells
Table Borders
Table Striping
Aligning Text
Completely Styled Table
HTML Coding Practices
Use the Proper Document Structure
Keeping the Syntax Organized
Use Practical ID and Class Values
CSS Coding Practices
Write CSS Using Multiple Lines and Spaces
Use Proper Class Names
Build Proficient Selectors
Use Desired Classes When Needed
Use Shorthand Hexadecimal Color Values
Drop Units Zero Values
HTML abbr tag
HTML acronym tag (Not for HTML 5)
HTML area tag
HTML basefont tag
HTML blockquote tag
HTML datalist tag
HTML Description List
HTML ins tag
Marquee HTML Tag
HTML object tag
HTML picture tag
HTML SVG
Let’s make a common layout of the page with keeping the header at the top, placing 2 columns at the center and providing a footer at the bottom. This page can be marked up by utilizing elements as talked in Chapter 2. Within the element, the HTML tags will be looking like:
The and the are block-level elements, and by default, they will be stacked on top of one another. But we want them to be side by side. For this, we have to float the element to the right and the element to the left. Our CSS will be like:
section {
float: left;
}
aside {
float: right;}
Whenever an element is made to float, it will stream right to the edge of its parent elements. In case there are no such parent elements, the element which is floated will them float right to the edge of the page.
When we are floating an element, we are taking it away from its original flow provided by the HTML document. This results in the element’s width to default with the content’s width inside it. But when we are making columns for a reusable layout, this behavior is not needed. It can be made right by adding a fixed property of 'width' to each column. In addition to that, to abolish the touching of floated elements, we can provide the property of ‘margin’ to provide spaces between them.
Let’s extend the previous code and add ‘margin’ as well as ‘width’ to each column.
section {
float: left;
margin: 0 1.5%;
width: 63%;
}
aside {
float: right;
margin: 0 1.5%;
width: 30%;
}
Having just 2 columns provides the ability to float one to the right and the other one to the left. But if we are having more than two columns then we need to change our approach. Let’s say we want to have a row of 3 columns between our header and footer elements. Our HTML will be looking like:
To place these 3 elements in a 3-row column, we will float all of them on the left. Here we also need to take care of the width of the elements. The CSS will be like this:
section {
float: left;
margin: 0 1.5%;
width: 30%;
}
Thus now we are having 3 columns, each of them have equal margin and width values and all are floated to the ‘left’.
Don't miss out!