In the world of web development, the visual appearance of a web page plays a super important role. This is where Cascading Style Sheets (CSS) come in as the language that lets developers control and tweak the presentation of HTML elements.
Do you know what CSS is?
CSS stands for Cascading Style Sheets, and it’s a stylesheet language used to style and format web pages written in HTML or XML. It allows separating content (HTML) and presentation (CSS), so developers can change how a web page looks without messing with its HTML structure.
This is the function of css:
Control Appearance: CSS lets developers control various aspects of a webpage’s look, like colors, fonts, sizes, layouts, and more.
Consistency: With CSS, developers can apply consistent styles across a webpage or even a whole website.
Responsiveness: CSS allows for creating responsive web designs that can adjust their appearance to different screen sizes and devices.
Efficiency: By separating content and presentation, CSS reduces the HTML file size and makes code maintenance easier.
Have you ever known the history of CSS?
Just to keep it short, CSS was first proposed byHåkon Wium Lie in 1994. In 1996, the World Wide Web Consortium (W3C) released the CSS level 1 recommendation. Since then, CSS has kept evolving with new features and performance improvements.
Here is the basic css syntax that you should know
Inline CSS
Inline CSS is the CSS code written directly within the HTML tag. So, it only affects a single line of HTML code.
For example: <p style="color: blue; font-size: 16px;">This text is blue.</p>.
The downside of using Inline CSS is that the HTML code becomes hard to read, and if you want to change the appearance of many elements, you have to change each one individually.
Internal CSS
Internal CSS is a way to change the design of a web page by inserting CSS code directly into an HTML document. Internal CSS is also known as embedded CSS. This is placed inside <style> the tag in the <head> HTML document section.
Using external CSS is the recommended way because it has some advantages, like:
Separating HTML and CSS code makes the HTML code cleaner and easier to read.
The HTML file size becomes smaller.
If you have a lot of web pages, you only need to change one CSS file to change the look of the entire website.
Basically, CSS is a super important tool in modern web development. By getting the basics of CSS, developers can create cool, responsive, and easy-to-maintain web pages.
Rizky Ramadhan
Content Writer
I am Rizky Ramadhan, a content writer and programmer who is passionate about sharing knowledge and experiences through writing and coding.
Ever heard the phrase “I want to be a programmer but I’m too lazy to code”? To be honest, you’re not alone! Many people are interested in the world of information technology (IT) and its bright career potential, but feel intimidated by the complicated coding process that requires a lot of persistence. The good news […]
Ever wondered how search engines understand your website’s structure? Or why some parts of your text stand out while others don’t? The answer lies in semantic HTML5. In this blog, we’re going to dive into why semantic elements like <mark>, <strong>, and many others are not just about visual appeal, but they also give meaning […]
Who here still gets nervous every time they hear the word “presentation”? Thinking about the same old slide designs, putting together points that make you sleepy, not to mention the last-minute typo drama. Ugh! Nah, here you go, I’ll share a secret recipe to make PowerPoint no longer a nightmare. Let’s get to know this […]
All novice programmers must know the Hamburger menu, right? It turns out that there are many types of menus used for websites, bro, not just hamburger menus. We already know that the Hamburger is known as a burger icon with a design that is often used to hide navigation menus in user interfaces. When the […]