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
There are several things to learn and understand – multiple attributes, values, elements, properties, and a lot more – for writing HTML as well as CSS code.Every chapter that we have dealt with till now has had the main objective of clarifying these different segments of HTML and CSS, to help you to comprehend the primary essentials of the two languages.
This chapter mainly centers on the best coding tips for both HTML and CSS. These coding rehearses fill in as a larger system for composing both the languages (HTML and CSS). They apply to each exercise and ought to consistently be remembered when programming.When you are going through these best practices, just think about how they can be utilized in multiple areas.
HTML Coding Practices
Several coding best practices focus on keeping code in a well-organized manner. The general practices inside HTML are the same. The aim is to write standard-compliant and well-structured markup. The guidelines stated here offer a brief intro to coding practices with HTML; this is in no shape, way or form a thorough rundown.
Write Standards-Compliant Markup
By nature, HTML is a forgiving language that provides poor code to render and execute to different levels of accuracy. Success in rendering doesn't imply that our code is correct semantically. Apart from that, poor codes are unpredictable, and it is uncertain about what you will get when it renders. It is recommended to pay close attention while writing HTML codes and make sure to close and nest all elements rightly, to use classes and IDs appropriately, what's more, to consistently approve our code.
The code given below has several errors, closing and
elements in an incorrect order, using the 'intro' ID attribute value several times, etc.
Bad Code
Good Code
Make Use of Semantic Elements
The number of elements present in HTML is quite large. To decide the right element for the right content may get hard sometime, but they only form the backbone of semantics. We need to double-check and research our code to make sure that we are utilizing the proper semantic elements.
Below is the HTML code that does not use a proper paragraph and heading elements; instead, it utilizes elements that are meaningless to group and style content.
Bad Code
Good Code
Don't miss out!