HTML and CSS are very well known in creating and styling web pages and other web applications. But there are differences between these two languages which I’m going to talk about in this article. So keep reading if it interests you.

HTML, short for hypertext markup language is s language used to create structures in a page which is a Must learn language while CSS short for cascading style sheet is used in the formatting features and getting the site to look better on browsers.

See also the difference between java and JavaScript.

Ok I think I’ll better explain this with a practical example here. I’m going to create a button with HTML button tag and show you the output, then I’ll do add CSS with it so you guys will review the new result and spot the differences yourself. Let’s now begin creating the button.

//creating the HTML button that says click me.

<button>click me</button>
Th default html styling of a button
Our HTML button which says click me

Now that we’ve seen how an ordinary HTML button looks like, I’ll then add CSS to my button so and show you the difference.

//creating the HTML button tag again

<button> click me</button>


//The CSS styling

<style>
button{

border:none;
color:white;
background:blue;
padding:10px;
width:100%;


}
 a button styled with CSS
The button with CSS added.

Now you see, the main purpose of CSS is to add formatting abilities to the HTML of your page. Not only for buttons, CSS has formatting for all HTML tags including tables, links, divs, even paragraphs.

What are the key differences between HTML and CSS.

  • HTML is used in creating web page structures while CSS designs those HTML structures making your webpage look more attractive.
  • HTML stands for Hypertext Markup Language while CSS stands for cascading style sheet.
  • You can write CSS in an HTML document but you can’t write HTML in a CSS document.
  • HTML alone can be used in building a static website while CSS needs to be linked to a HTML document for it to function.
  • HTML works with opening and closing tags in defining a web structure while CSS uses selectors with curvy braces.

HTML and CSS are like a family, they both work together in building a complete attractive webpage but are completely different from each other. JavaScript is also used in the webpage to add interactive elements in the webpage like what happens when you click a button, some animations and others which is why you should learn HTML and CSS before JavaScript.

Here you have it, my key differences between HTML and CSS. If this article answered your questions you’re free to leave a comment below, we’ll appreciate that. Also remember we’re on social media too! You can follow is to stay updated on any new post using any of the links below

You can also message us using our official email address hello@charmingdesk.com.ng

Kudos on your web development journey!!


vic okeke

I'm just a web developer hoping to help out junior developers in algorithms for their projects.

0 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *