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.
Bored with the browser’s default scrollbar? Want your website to look more unique and attract visitors? Well, you’re in the right place! In this article, we’ll explore how to modify your website’s scrollbar with just a touch of CSS. It’s really easy, let’s get straight to it! Scrollbars are essential for navigation, especially on long […]
Do you often find it difficult to explain complex workflows? Or maybe you want to present your business processes in a more engaging and easy-to-understand way? If so, then flowchart is the answer! A flowchart, or flowchart, is a visual representation of the steps in a process. With a clear flowchart, communication becomes more effective, […]
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 […]