Web Development #5 - How to add CSS to HTML file?
Hello Everybody, i hope all is ok 👋 👋
In this post i'll explain you how we can add our first styles in a html file.
CSS Inline
The first way to add the css in our html file, is doing it directly in each html tag, this form is not very recommended as it is not very optimal for the code and also nice to see every html tag full of css code.
The way it is used is by adding the 'style' attribute and in the value go the css properties ...
Internal style sheet
The second way is to add css is directly to the html file, we do not use it in the label directly but if we use it by putting the css properties inside the <style> css here </ style>
tags and this tag must go inside The <head> </ head>
tags, we recommend this form only when we have a single html file and not this one does not carry much css.
Here is a very basic example ...🤓 🤓
External style sheet
This third form is the most used when developing a web page since it facilitates the way to add css and not mix it with the css code, it is much more pleasant and also more optimum when loading the styles of a web page, For this we must create a file 'name.css' should always carry the css extension, since it is the one that tells us it is a css file, and once we create the file we add it by means of the tag <link>
in The html file, below we see an example of how it is done ... 👩💻 👨💻
Then we add the css code in our css file as well ...
Those are the three ways to add css to our html, the best way is the latest and most recommended.
That's all for this post, I hope it has been made clear and see you in the next.
Thank you! 🤓 😎
Congratulations! This post has been upvoted from the communal account, @minnowsupport, by juanpchica from the Minnow Support Project. It's a witness project run by aggroed, ausbitbank, teamsteem, theprophet0, and someguy123. The goal is to help Steemit grow by supporting Minnows and creating a social network. Please find us in the Peace, Abundance, and Liberty Network (PALnet) Discord Channel. It's a completely public and open space to all members of the Steemit community who voluntarily choose to be there.
If you like what we're doing please upvote this comment so we can continue to build the community account that's supporting all members.
Congratulations @juanpchica! You have completed some achievement on Steemit and have been rewarded with new badge(s) :
Click on any badge to view your own Board of Honor on SteemitBoard.
For more information about SteemitBoard, click here
If you no longer want to receive notifications, reply to this comment with the word
STOP