A COMPLETE HTML AND CSS
GUIDELINES FOR BEGINNERS
If you are new at html & css then you
should familiar about these Guidelines
before start. Let’s discuss about HTML and
CSS Guidelines for Beginners in this post
for better UI and UX designs.
Guidelines to follow
Html
CSS
Class
Section
Single page CSS
CSS/JavaScript custom file
Proper commenting
Code reusability
CSS according framework
Code check
HTML – Hypertext Markup Language:
All critical website content should be added
to the website using a markup language
such as HTML.
Proper comment section should be used
before writing any code because it will help
us in identifying why this code has been
written and what is the use.
Always add “alt” attributes to images
because it will help when an image for
some reason cannot be displayed Use
lower case element and attribute names.
Use correct document type – Always
declare the document type as the first line
in your document.
Close all HTML elements and quote the
attribute values.
Do not add blank lines & indentation
unnecessarily.
Avoid code lines over 80 characters.
Representation of HTML:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
<!-- website templates CSS -->
<link rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstr
<!-- custom CSS -->
<link rel="stylesheet" type="text/css" href="m
<!-- website templates fonts -->
<link href="https://fonts.googleapis.com/css?f
</head>
<body>
<div id="header">
<div class="header">
<div class="nav"></div>
</div>
</div>
21
22
23
24
25
26
27
28
</body>
<!-- jQuery library -->
<script
src="https://ajax.googleapis.com/ajax/libs/jque
<!-- website template JavaScript -->
<script
src="https://maxcdn.bootstrapcdn.com/bootstra
<!-- custom date picker JavaScript -->
<script src="/js/myScript1.js"></script>
</html>
CSS – Cascading style sheets:
Presentation of the website content should
be defined by a styling language such as
CSS.
Use simple syntax for linking to style sheets
(the type attribute is not necessary) with
proper comments.
Place the opening bracket on the same line
as the selector
Use one space before the opening bracket
Use two spaces for indentation
Use semicolon after each property-value pair,
including the last
Only use quotes around values if the value
contains spaces
Place the closing bracket on a new line,
without leading spaces
Avoid lines over 80 characters
New file should be used for creating CSS
Representation of CSS:
1
2
body {
overflow-x: hidden !important;
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
display: block;
font-family: 'Open Sans', sans-serif
!important;
color: #000;
}
h1, h2, h3, h4, h5, h6, p, span, a, ul, li {
margin: 0px;
padding: 0px;
}
a:hover, a:focus {
text-decoration: none;
color: #1A237E
}
25
26
27
28
29
30
31
32
33
34
/* header section CSS*/
.header{}
/* mid-section CSS*/
.mid{}
/* footer section CSS*/
Class:
If there are multiple elements on a single
web page and that need to be styled then
we use classes. For example, let’s say that
you want give a redirect a particular button
to some site or at new page or at pressing
the button it’s color should be change. So
for modifying colors & redirecting page to
some link we use classes and for that you
could add a class to each of those button or
the container holding the buttons.
Representation of classes:
1
2
3
4
5
6
7
8
9
10
11
12
13
.bgcolor {
width: 100%;
float: left;
height: 700px;
background-color: #4ca368;
}
div.cities {
background-color: black;
color: white;
margin: 20px 0 20px 0;
padding: 20px;
14 }
CSS/JavaScript custom file:
We are using a framework using different
libraries then we should not change the
library files instead of that we should create
another file and then do the customization.
For example, in bootstrap, we are using a
navbar and it contains its own CSS file
navbar-default and we are asked to change
in that particular file so for that we’ll create
a new custom CSS file.
Bootstrap library file:
1
2
3
.navbar-default {
text-decoration: none;
background color: #1A237E;
4
5
6
7
8
9
10
11
}
Custom file
.navbar-default {
background color: #5aD782;
color: #ff00ff;
}
CSS According Framework:
A framework is defined as a package made
up of the structure of files and folders of
standardized code (HTML, CSS, JS
documents etc.) which can be used to
support the development of the website, as
a basis to start building a site. So as to use
framework we should place the library
along with proper commenting.
Representation of Library:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstr
<!-- jQuery library -->
<script
src="https://ajax.googleapis.com/ajax/libs/jque
<!-- Latest compiled JavaScript -->
<script
src="https://maxcdn.bootstrapcdn.com/bootstra
<div class="container">
<div class="row">
<div class="col-sm-4">
<h3>Column 1</h3>
<p>Lorem ipsum dolor..</p>
<p>Ut enim ad..</p>
</div>
20
21
22
23
24
25
26
27
28
<div class="col-sm-4">
<h3>Column 2</h3>
<p>Lorem ipsum dolor..</p>
<p>Ut enim ad..</p>
</div>
<div class="col-sm-4">
<h3>Column 3</h3>
<p>Lorem ipsum dolor..</p>
<p>Ut enim ad..</p>
</div>
</div>
</div>
Single Page CSS:
For every page, there should be separate
CSS file and it should contain the
information about that particular page only.
For example, let’s say there are four pages
(Home, About Us, Products Contact Us) so
for each and every page there should be
separate CSS file with proper commenting
and relevant names.
Code Re-usability:
Code which shares a very similar or
identical structure should be written in such
a way that it can be used further. The aim
of code reusability is to provide a common
structure so that developers don’t have to
redo it from scratch and can reuse the code
provided. In this way, code reusability
allows us to cut out much of the work and
save a lot of time.
Code Check:
Before submitting the code it should be
reviewed and checked properly maintaining
the above guidelines rules. It will help
understand the third party user easily
without facing any difficulties.
In this post we discuss html and css
guidelines for absolute beginners.
We are web application
development and mobile app
development experts. Discuss with us
about your project: Contact Us
Hope you found this post helpful, so don’t
forget to share with friends.

More Related Content

ODP
Cascading Style Sheets - Part 02
PDF
Efficient, maintainable CSS
PPTX
HTML CSS and Web Development
PDF
CSS3 Introduction
PPTX
Presentation about html5 css3
PPT
How Cascading Style Sheets (CSS) Works
PDF
CSS Best practice
Cascading Style Sheets - Part 02
Efficient, maintainable CSS
HTML CSS and Web Development
CSS3 Introduction
Presentation about html5 css3
How Cascading Style Sheets (CSS) Works
CSS Best practice

What's hot (20)

PPT
Html & CSS - Best practices 2-hour-workshop
PPT
Introduction to Cascading Style Sheets (CSS)
PPTX
Introducing Cascading Style Sheets
PPT
Css best practices style guide and tips
KEY
HTML CSS & Javascript
PPTX
Cascading Style Sheets - CSS
PDF
Fundamental CSS3
PPTX
Html & CSS
PDF
Introduction to css
PPTX
Web development using HTML and CSS
PPTX
Css tips & tricks
PPT
Cascading Style Sheets
PDF
Introduction to HTML and CSS
PPTX
David Weliver
PPTX
What is CSS?
PPTX
Cascading style sheets (CSS)
PPTX
Web 102 INtro to CSS
PPTX
Introduction to HTML and CSS
PDF
Css introduction
Html & CSS - Best practices 2-hour-workshop
Introduction to Cascading Style Sheets (CSS)
Introducing Cascading Style Sheets
Css best practices style guide and tips
HTML CSS & Javascript
Cascading Style Sheets - CSS
Fundamental CSS3
Html & CSS
Introduction to css
Web development using HTML and CSS
Css tips & tricks
Cascading Style Sheets
Introduction to HTML and CSS
David Weliver
What is CSS?
Cascading style sheets (CSS)
Web 102 INtro to CSS
Introduction to HTML and CSS
Css introduction
Ad

Similar to A complete html and css guidelines for beginners (20)

ODP
HTML5, CSS, JavaScript Style guide and coding conventions
PDF
HTML and CSS Coding Standards
PDF
Structuring your CSS for maintainability: rules and guile lines to write CSS
PDF
Creative Web 02 - HTML & CSS Basics
PPTX
Css for Development
PPTX
2h landing page
PPTX
GDG On Campus NBNSCOE Web Workshop Day 1 : HTML & CSS
PDF
Basics of Rich Internet Applications
PDF
Pfnp slides
PDF
Create a landing page
PDF
CSS: a rapidly changing world
PDF
Part 2 in depth guide on word-press coding standards for css &amp; js big
PDF
Css tools and methodologies
PPTX
The New UI - Staying Strong with Flexbox, SASS, and {{Mustache.js}}
PPTX
CSS Walktrough Internship Course
PPT
CSS Overview
KEY
Team styles
PDF
Accelerated Stylesheets
PPTX
How To Write Beautiful Code
PPT
HTML5, CSS, JavaScript Style guide and coding conventions
HTML and CSS Coding Standards
Structuring your CSS for maintainability: rules and guile lines to write CSS
Creative Web 02 - HTML & CSS Basics
Css for Development
2h landing page
GDG On Campus NBNSCOE Web Workshop Day 1 : HTML & CSS
Basics of Rich Internet Applications
Pfnp slides
Create a landing page
CSS: a rapidly changing world
Part 2 in depth guide on word-press coding standards for css &amp; js big
Css tools and methodologies
The New UI - Staying Strong with Flexbox, SASS, and {{Mustache.js}}
CSS Walktrough Internship Course
CSS Overview
Team styles
Accelerated Stylesheets
How To Write Beautiful Code
Ad

Recently uploaded (20)

PDF
Slides World Game (s) Great Redesign Eco Economic Epochs.pdf
PPTX
maintenance powerrpoint for adaprive and preventive
PPTX
Presentation - Principles of Instructional Design.pptx
PPTX
AQUEEL MUSHTAQUE FAKIH COMPUTER CENTER .
PDF
【AI論文解説】高速・高品質な生成を実現するFlow Map Models(Part 1~3)
PDF
TrustArc Webinar - Data Minimization in Practice_ Reducing Risk, Enhancing Co...
PPTX
Blending method and technology for hydrogen.pptx
PPTX
Strategic Picks — Prioritising the Right Agentic Use Cases [2/6]
PDF
GDG Cloud Southlake #45: Patrick Debois: The Impact of GenAI on Development a...
PDF
Secure Java Applications against Quantum Threats
PDF
Human Computer Interaction Miterm Lesson
PDF
Uncertainty-aware contextual multi-armed bandits for recommendations in e-com...
PDF
substrate PowerPoint Presentation basic one
PDF
The Digital Engine Room: Unlocking APAC’s Economic and Digital Potential thro...
PPTX
CRM(Customer Relationship Managmnet) Presentation
PPTX
Rise of the Digital Control Grid Zeee Media and Hope and Tivon FTWProject.com
PDF
NewMind AI Journal Monthly Chronicles - August 2025
PDF
1_Keynote_Breaking Barriers_한계를 넘어서_Charith Mendis.pdf
PDF
Addressing the challenges of harmonizing law and artificial intelligence tech...
PDF
Be ready for tomorrow’s needs with a longer-lasting, higher-performing PC
Slides World Game (s) Great Redesign Eco Economic Epochs.pdf
maintenance powerrpoint for adaprive and preventive
Presentation - Principles of Instructional Design.pptx
AQUEEL MUSHTAQUE FAKIH COMPUTER CENTER .
【AI論文解説】高速・高品質な生成を実現するFlow Map Models(Part 1~3)
TrustArc Webinar - Data Minimization in Practice_ Reducing Risk, Enhancing Co...
Blending method and technology for hydrogen.pptx
Strategic Picks — Prioritising the Right Agentic Use Cases [2/6]
GDG Cloud Southlake #45: Patrick Debois: The Impact of GenAI on Development a...
Secure Java Applications against Quantum Threats
Human Computer Interaction Miterm Lesson
Uncertainty-aware contextual multi-armed bandits for recommendations in e-com...
substrate PowerPoint Presentation basic one
The Digital Engine Room: Unlocking APAC’s Economic and Digital Potential thro...
CRM(Customer Relationship Managmnet) Presentation
Rise of the Digital Control Grid Zeee Media and Hope and Tivon FTWProject.com
NewMind AI Journal Monthly Chronicles - August 2025
1_Keynote_Breaking Barriers_한계를 넘어서_Charith Mendis.pdf
Addressing the challenges of harmonizing law and artificial intelligence tech...
Be ready for tomorrow’s needs with a longer-lasting, higher-performing PC

A complete html and css guidelines for beginners

  • 1. A COMPLETE HTML AND CSS GUIDELINES FOR BEGINNERS If you are new at html & css then you should familiar about these Guidelines before start. Let’s discuss about HTML and CSS Guidelines for Beginners in this post for better UI and UX designs.
  • 2. Guidelines to follow Html CSS Class Section Single page CSS CSS/JavaScript custom file Proper commenting Code reusability CSS according framework Code check HTML – Hypertext Markup Language: All critical website content should be added to the website using a markup language such as HTML. Proper comment section should be used before writing any code because it will help
  • 3. us in identifying why this code has been written and what is the use. Always add “alt” attributes to images because it will help when an image for some reason cannot be displayed Use lower case element and attribute names. Use correct document type – Always declare the document type as the first line in your document. Close all HTML elements and quote the attribute values. Do not add blank lines & indentation unnecessarily. Avoid code lines over 80 characters.
  • 4. Representation of HTML: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 <!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8"> <title></title> <!-- website templates CSS --> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstr <!-- custom CSS --> <link rel="stylesheet" type="text/css" href="m <!-- website templates fonts --> <link href="https://fonts.googleapis.com/css?f </head> <body> <div id="header"> <div class="header"> <div class="nav"></div> </div> </div>
  • 5. 21 22 23 24 25 26 27 28 </body> <!-- jQuery library --> <script src="https://ajax.googleapis.com/ajax/libs/jque <!-- website template JavaScript --> <script src="https://maxcdn.bootstrapcdn.com/bootstra <!-- custom date picker JavaScript --> <script src="/js/myScript1.js"></script> </html> CSS – Cascading style sheets: Presentation of the website content should be defined by a styling language such as CSS. Use simple syntax for linking to style sheets
  • 6. (the type attribute is not necessary) with proper comments. Place the opening bracket on the same line as the selector Use one space before the opening bracket Use two spaces for indentation Use semicolon after each property-value pair, including the last Only use quotes around values if the value contains spaces Place the closing bracket on a new line, without leading spaces Avoid lines over 80 characters New file should be used for creating CSS Representation of CSS: 1 2 body { overflow-x: hidden !important;
  • 7. 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 display: block; font-family: 'Open Sans', sans-serif !important; color: #000; } h1, h2, h3, h4, h5, h6, p, span, a, ul, li { margin: 0px; padding: 0px; } a:hover, a:focus { text-decoration: none; color: #1A237E }
  • 8. 25 26 27 28 29 30 31 32 33 34 /* header section CSS*/ .header{} /* mid-section CSS*/ .mid{} /* footer section CSS*/ Class: If there are multiple elements on a single web page and that need to be styled then we use classes. For example, let’s say that you want give a redirect a particular button to some site or at new page or at pressing
  • 9. the button it’s color should be change. So for modifying colors & redirecting page to some link we use classes and for that you could add a class to each of those button or the container holding the buttons. Representation of classes: 1 2 3 4 5 6 7 8 9 10 11 12 13 .bgcolor { width: 100%; float: left; height: 700px; background-color: #4ca368; } div.cities { background-color: black; color: white; margin: 20px 0 20px 0; padding: 20px;
  • 10. 14 } CSS/JavaScript custom file: We are using a framework using different libraries then we should not change the library files instead of that we should create another file and then do the customization. For example, in bootstrap, we are using a navbar and it contains its own CSS file navbar-default and we are asked to change in that particular file so for that we’ll create a new custom CSS file. Bootstrap library file: 1 2 3 .navbar-default { text-decoration: none; background color: #1A237E;
  • 11. 4 5 6 7 8 9 10 11 } Custom file .navbar-default { background color: #5aD782; color: #ff00ff; } CSS According Framework: A framework is defined as a package made up of the structure of files and folders of standardized code (HTML, CSS, JS documents etc.) which can be used to support the development of the website, as a basis to start building a site. So as to use framework we should place the library along with proper commenting.
  • 12. Representation of Library: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 <!-- Latest compiled and minified CSS --> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstr <!-- jQuery library --> <script src="https://ajax.googleapis.com/ajax/libs/jque <!-- Latest compiled JavaScript --> <script src="https://maxcdn.bootstrapcdn.com/bootstra <div class="container"> <div class="row"> <div class="col-sm-4"> <h3>Column 1</h3> <p>Lorem ipsum dolor..</p> <p>Ut enim ad..</p> </div>
  • 13. 20 21 22 23 24 25 26 27 28 <div class="col-sm-4"> <h3>Column 2</h3> <p>Lorem ipsum dolor..</p> <p>Ut enim ad..</p> </div> <div class="col-sm-4"> <h3>Column 3</h3> <p>Lorem ipsum dolor..</p> <p>Ut enim ad..</p> </div> </div> </div> Single Page CSS: For every page, there should be separate CSS file and it should contain the information about that particular page only. For example, let’s say there are four pages (Home, About Us, Products Contact Us) so
  • 14. for each and every page there should be separate CSS file with proper commenting and relevant names. Code Re-usability: Code which shares a very similar or identical structure should be written in such a way that it can be used further. The aim of code reusability is to provide a common structure so that developers don’t have to redo it from scratch and can reuse the code provided. In this way, code reusability allows us to cut out much of the work and save a lot of time. Code Check: Before submitting the code it should be reviewed and checked properly maintaining
  • 15. the above guidelines rules. It will help understand the third party user easily without facing any difficulties. In this post we discuss html and css guidelines for absolute beginners. We are web application development and mobile app development experts. Discuss with us about your project: Contact Us Hope you found this post helpful, so don’t forget to share with friends.