How do I share an HTML and CSS code file?

Asked by Last Modified  

Follow 1
Answer

Please enter your answer

There are different ways to write CSS code 1) external on a seperate file with .css extension 2) Internal as part of the head section of the HTML page 3) embeded as part of the HTML tag The easiest way is to have an external CSS file and then to link it. !DOCTYPE html><html><head><link...
read more
There are different ways to write CSS code 1) external on a seperate file with .css extension 2) Internal as part of the head section of the HTML page 3) embeded as part of the HTML tag The easiest way is to have an external CSS file and then to link it. !DOCTYPEhtml><html><head><linkrel="stylesheet"href="mystyle.css"></head><body><h1>This is a heading</h1><p>This is a paragraph.</p></body></html> here you have both the HTML file and CSS file in the same folder . for example the mystyle.css file can have the below code\ body{background-color:lightblue;}h1{color:navy;margin-left:20px;} we use this if we want the whole website to be consistent, so we link to each and every web page . Internal CSS An internal style sheet may be used if one single HTML page has a unique style. The internal style is defined inside the <style> element, inside the head section. <!DOCTYPEhtml><html><head><style>body{ background-color:linen;}h1{ color:maroon; margin-left:40px;}</style></head><body><h1>This is a heading</h1><p>This is a paragraph.</p></body></html> Inline CSS An inline style may be used to apply a unique style for a single element. To use inline styles, add the style attribute to the relevant element. The style attribute can contain any CSS property. <!DOCTYPEhtml><html><body><h1style="color:blue;text-align:center;">This is a heading</h1><pstyle="color:red;">This is a paragraph.</p></body></html> Reference https://www.w3schools.com/ read less
Comments

Related Questions

How do you connect a CSS styling sheet to an HTML page?
Using internal Css and Inline Css.
Asif
0 0
5
I want to be a web/ios/android developer though I have studied till class10. So can I do the course to work as a freelancer? M y main query is I have heard about many things which we get to study when we do B.Sc but I am not up to that level so can I do the course?
Hi Ashutosh , I like your confidence and would like to say definitively you can do the course , as you are upto 10 th class so it may be very difficult to get jobs in companies but if you will have good...
Ashutosh
What is the best text editor for writing HTML and CSS?
Best Text Editors for HTML & CSS 1. VS Code -- Fast, extensions, IntelliSense. 2. Sublime Text -- Lightweight, fast, multi-cursor editing. 3. Atom -- Open-source, customizable (discontinued...
Janardan
0 0
5
What is a CSS File? It is used for what purpose?
Cascading Style Sheets (CSS) is a stylesheet language used to describe the presentation of a document written in HTML or XML (including XML dialects such as SVG, MathML or XHTML). CSS describes how elements...
Pravin
0 0
5

Why is HTML is used in Web Application?

The role of HTML in web development is to provide the backbone and structure of a web page. It defines the layout and organization of content on a web page by using a ranked structure of elements. HTML...
Karthick Ramesh Kumar
0 0
8

Now ask question in any of the 1000+ Categories, and get Answers from Tutors and Trainers on UrbanPro.com

Ask a Question

Related Lessons


Pro Developer Program Syllabus
What you will learn in Pro-Developer Program: i. Introduction to Web Technologies. ii. Introduction to .Net - Features of .Net, CTS, CLS, CLR and MSIL. iii. C# & .Net Basics - Data Types,...

Kick start your IT career with User Interface development
If you are planning to start your career into IT, you can begin as User Interface developer. No previous IT background or programming experience needed. Below are some of the responsibilties of User...

CSS awesome tips
CSS - Cascading Style Sheet is used to beautify Web pages and there are some common things which are very basic yet conceptual and very important for development. So here are some of the important tips...

Add shadows to boxes with HTML 5.0 and CSS 3.0
1) Hi! lets learn how to drop shadows for the boxes. First let's create a simple box in html <!doctype html><html><div>Hi this is a box</div></html> 2) Now lets give it...

Recommended Articles

Today, no business can exist without having its own website to interact with its customer base. Having a website is no more restricted to the big MNCs. With the advancement in technology and global business, even the small enterprises are spending on having their own websites and development teams. The person works on web...

Read full article >

Since the world today is ruled by the Internet, everyone desires to build a website for either business or personal interests. HTML or Hyper-text Mark-up Language is a globally standardized language which used to format web pages. By using HTML, the appearance of text, links, images and almost every part of a web page could...

Read full article >

Microsoft Excel is an electronic spreadsheet tool which is commonly used for financial and statistical data processing. It has been developed by Microsoft and forms a major component of the widely used Microsoft Office. From individual users to the top IT companies, Excel is used worldwide. Excel is one of the most important...

Read full article >

Business Process outsourcing (BPO) services can be considered as a kind of outsourcing which involves subletting of specific functions associated with any business to a third party service provider. BPO is usually administered as a cost-saving procedure for functions which an organization needs but does not rely upon to...

Read full article >

Looking for CSS Training?

Learn from the Best Tutors on UrbanPro

Are you a Tutor or Training Institute?

Join UrbanPro Today to find students near you