{"id":576,"date":"2025-05-19T10:47:10","date_gmt":"2025-05-19T10:47:10","guid":{"rendered":"https:\/\/buhave.com\/courses\/?p=576"},"modified":"2026-06-06T13:19:21","modified_gmt":"2026-06-06T13:19:21","slug":"basic-css-properties","status":"publish","type":"post","link":"https:\/\/buhave.com\/courses\/css\/basic-css-properties\/","title":{"rendered":"Basic CSS Properties"},"content":{"rendered":"<h2>Styling text: font-family, font-size, font-weight, text-align<\/h2>\n<p>In CSS, styling text is one of the core parts of creating visually attractive and readable web pages. <a href=\"https:\/\/buhave.com\/courses\/css\/introduction-to-css\/\" title=\"Introduction to CSS\">Introduction to CSS<\/a> provides a quick refresher on CSS fundamentals.<br \/>\nThe main properties used for text styling include font-family, font-size, font-weight, and text-align. Each controls a different aspect of how text appears to users.<\/p>\n<h3>1. font-family (Choosing the Font Type)<\/h3>\n<p><strong>Definition:<\/strong><\/p>\n<p>The font-family property specifies the typeface (font) to be used for the text inside an element.<\/p>\n<p><strong>Syntax:<\/strong><\/p>\n<p style=\"text-align: center\"><em>selector {<\/em><br \/>\n<em>font-family: &#8220;Font Name&#8221;, fallback-font, generic-family;<\/em><br \/>\n<em>}<\/em><\/p>\n<p><strong>Example:<\/strong><\/p>\n<p style=\"text-align: center\"><em>p {<\/em><br \/>\n<em>font-family: &#8220;Arial&#8221;, &#8220;Helvetica&#8221;, sans-serif;<\/em><br \/>\n<em>}<\/em><\/p>\n<p><strong>Explanation:<\/strong><\/p>\n<ul>\n<li>First tries to use &#8220;Arial&#8221;.<\/li>\n<li>If &#8220;Arial&#8221; isn\u2019t available, tries &#8220;Helvetica&#8221;.<\/li>\n<li>If neither is available, defaults to any available sans-serif font.<\/li>\n<\/ul>\n<p>Best Practice: Always provide fallback fonts to ensure good rendering across different devices.<\/p>\n<p>For a quick refresher on font fundamentals, see <a href=\"https:\/\/buhave.com\/courses\/css\/introduction-to-css\/\" title=\"Introduction to CSS\">Introduction to CSS<\/a>.<\/p>\n<h3>2. font-size (Controlling the Size of Text)<\/h3>\n<p><strong>Definition:<\/strong><\/p>\n<p>The font-size property sets the size of the text, controlling how large or small the text appears.<\/p>\n<p><strong>Syntax:<\/strong><\/p>\n<p style=\"text-align: center\"><em>selector {<\/em><br \/>\n<em>font-size: size;<\/em><br \/>\n<em>}<\/em><\/p>\n<p><strong>Common Units:<\/strong><\/p>\n<ul>\n<li>Pixels (px) \u2014 fixed size (e.g., 16px)<\/li>\n<li>Em (em) \u2014 relative to the parent\u2019s font size (e.g., 1.5em)<\/li>\n<li>Rem (rem) \u2014 relative to the root (html) font size (e.g., 1rem)<\/li>\n<li>Percentages (%) \u2014 relative to the parent element\u2019s font size<\/li>\n<li>Viewport units (e.g., vw, vh) \u2014 scale with the viewport size<\/li>\n<\/ul>\n<p><strong>Example:<\/strong><\/p>\n<p style=\"text-align: center\"><em>h1 {<\/em><br \/>\n<em>font-size: 32px;<\/em><br \/>\n<em>}<\/em><br \/>\n<em>p {<\/em><br \/>\n<em>font-size: 1.2em;<\/em><br \/>\n<em>}<\/em><\/p>\n<p>Best Practice: Use rem or em for more responsive and accessible designs. Modern typography also benefits from fluid approaches like clamp() to combine rem units with viewport-based scaling.<\/p>\n<p>For practical guidance on responsive typography, see <a href=\"https:\/\/buhave.com\/courses\/css\/best-practices-and-optimization\/\" title=\"Best Practices and Optimization\">Best Practices and Optimization<\/a>.<\/p>\n<h3>3. font-weight (Setting Text Boldness or Lightness)<\/h3>\n<p><strong>Definition:<\/strong><\/p>\n<p>The font-weight property defines how thick or thin the characters of the text appear.<\/p>\n<p><strong>Syntax:<\/strong><\/p>\n<p style=\"text-align: center\"><em>selector {<\/em><br \/>\n<em>font-weight: weight-value;<\/em><br \/>\n<em>}<\/em><\/p>\n<p><strong>Common Values:<\/strong><\/p>\n<ul>\n<li>normal (default, regular weight)<\/li>\n<li>bold (makes text thicker)<\/li>\n<li>lighter (makes text thinner than its parent)<\/li>\n<li>Numeric values: 100 (very thin) to 900 (very thick)<\/li>\n<\/ul>\n<p><strong>Example:<\/strong><\/p>\n<p style=\"text-align: center\"><em>strong {<\/em><br \/>\n<em>font-weight: bold;<\/em><br \/>\n<em>}<\/em><br \/>\n<em>h2 {<\/em><br \/>\n<em>font-weight: 600;<\/em><br \/>\n<em>}<\/em><\/p>\n<p>Best Practice: Prefer numeric weights for precise control, especially with modern web fonts. Consider variable fonts for finer weight adjustments and performance benefits. <a href=\"https:\/\/buhave.com\/courses\/css\/best-practices-and-optimization\/\" title=\"Best Practices and Optimization\">Best Practices and Optimization<\/a>.<\/p>\n<p><strong>Note:<\/strong> With variable fonts, you can access a continuous range of weights rather than a fixed set, enabling finer typography control without multiple font files.<\/p>\n<\/p>\n<h3>4. text-align (Aligning Text Horizontally)<\/h3>\n<p><strong>Definition:<\/strong><\/p>\n<p>The text-align property sets the horizontal alignment of text inside a block-level element.<\/p>\n<p><strong>Syntax:<\/strong><\/p>\n<p style=\"text-align: center\"><em>selector {<\/em><br \/>\n<em>text-align: alignment;<\/em><br \/>\n<em>}<\/em><\/p>\n<p><strong>Common Values:<\/strong><\/p>\n<ul>\n<li>left (default for left-to-right languages)<\/li>\n<li>right<\/li>\n<li>center<\/li>\n<li>justify (stretches text to fit the width by adjusting spaces)<\/li>\n<\/ul>\n<p><strong>Example:<\/strong><\/p>\n<p style=\"text-align: center\"><em>h1 {<\/em><br \/>\n<em>text-align: center;<\/em><br \/>\n<em>}<\/em><br \/>\n<em>p {<\/em><br \/>\n<em>text-align: justify;<\/em><br \/>\n<em>}<\/em><\/p>\n<p>&nbsp;<\/p>\n<p><strong>Best Practice:<\/strong>\u00a0Use justify for longer paragraphs to create a neat column of text; use center for headings and call-to-action texts. For layout and alignment strategies in more complex designs, see <a href=\"https:\/\/buhave.com\/courses\/css\/css-positioning\/\" title=\"CSS Positioning\">CSS Positioning<\/a>.<\/p>\n<p><strong>Combined Example:<\/strong><\/p>\n<p style=\"text-align: center\"><em>.article-title {<\/em><br \/>\n<em>font-family: &#8216;Georgia&#8217;, serif;<\/em><br \/>\n<em>font-size: 28px;<\/em><br \/>\n<em>font-weight: bold;<\/em><br \/>\n<em>text-align: center;<\/em><br \/>\n<em>}<\/em><\/p>\n<p style=\"text-align: center\"><em>.article-body {<\/em><br \/>\n<em>font-family: &#8216;Open Sans&#8217;, sans-serif;<\/em><br \/>\n<em>font-size: 16px;<\/em><br \/>\n<em>font-weight: normal;<\/em><br \/>\n<em>text-align: justify;<\/em><br \/>\n<em>}<\/em><\/p>\n<p><strong>Explanation:<\/strong><\/p>\n<ul>\n<li>The title (.article-title) uses &#8220;Georgia&#8221; font, large size, bold weight, and centered alignment.<\/li>\n<li>The body text (.article-body) uses &#8220;Open Sans&#8221;, standard size, normal weight, and justified text.<\/li>\n<\/ul>\n<p><strong>Summary Table:<\/strong><\/p>\n<p><strong>Summary Table:<\/strong><\/p>\n<table>\n<thead>\n<tr>\n<th>Property<\/th>\n<th>Purpose<\/th>\n<th>Example Value<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>font-family<\/td>\n<td>Sets the font type<\/td>\n<td>&#8220;Arial&#8221;, sans-serif<\/td>\n<\/tr>\n<tr>\n<td>font-size<\/td>\n<td>Controls text size<\/td>\n<td>16px, 1.5em, 100%<\/td>\n<\/tr>\n<tr>\n<td>font-weight<\/td>\n<td>Adjusts thickness or boldness<\/td>\n<td>bold, 400, 700<\/td>\n<\/tr>\n<tr>\n<td>text-align<\/td>\n<td>Aligns text horizontally<\/td>\n<td>left, center, justify<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Conclusion<br \/>\nBy using font-family, font-size, font-weight, and text-align, you can control almost every important aspect of how your text looks on a web page \u2014 making it readable, visually appealing, and aligned with your design goals. As you scale your styles, consider exploring related topics like CSS Selector and CSS Positioning.<\/p>\n<h2>Color and background styling: background-color, background-image, color properties<\/h2>\n<p>Color and background styling are fundamental in web design because they control how your webpage looks and feels.<br \/>\nCSS provides specific properties to customize both the text color and the background of HTML elements.<\/p>\n<h3>1. color (Text Color)<\/h3>\n<p><strong>Definition:<\/strong><\/p>\n<p>The color property in CSS sets the color of the text inside an element.<\/p>\n<p><strong>Syntax:<\/strong><\/p>\n<p style=\"text-align: center\"><em>selector {<\/em><br \/>\n<em>color: value;<\/em><br \/>\n<em>}<\/em><\/p>\n<p><strong>Value Types:<\/strong><\/p>\n<ul>\n<li>Named colors: red, blue, green<\/li>\n<li>Hexadecimal values: #ff5733, #000000<\/li>\n<li>RGB values: rgb(255, 87, 51)<\/li>\n<li>RGBA values (RGB + Alpha for transparency): rgba(255, 87, 51, 0.5)<\/li>\n<li>HSL values (Hue, Saturation, Lightness): hsl(12, 100%, 60%)<\/li>\n<\/ul>\n<p><strong>Example:<\/strong><\/p>\n<p style=\"text-align: center\"><em>p {<\/em><br \/>\n<em>color: #333333;<\/em><br \/>\n<em>}<\/em><\/p>\n<p style=\"text-align: center\"><em>h1 {<\/em><br \/>\n<em>color: rgb(255, 0, 0);<\/em><br \/>\n<em>}<\/em><\/p>\n<p><strong>Best Practice:<\/strong><\/p>\n<p>Use a consistent color palette and ensure enough contrast between text and background for readability (especially for accessibility).<\/p>\n<p>For accessibility considerations, you can explore WCAG guidance in the related course content linked above. See <a href=\"https:\/\/buhave.com\/courses\/css\/best-practices-and-optimization\/\" title=\"Best Practices and Optimization\">Best Practices and Optimization<\/a>.<\/p>\n<h3>2. background-color (Background Fill Color)<\/h3>\n<p><strong>Definition:<\/strong><\/p>\n<p>The background-color property sets the background color of an element.<\/p>\n<p><strong>Syntax:<\/strong><\/p>\n<p style=\"text-align: center\"><em>selector {<\/em><br \/>\n<em>background-color: value;<\/em><br \/>\n<em>}<\/em><\/p>\n<p><strong>Value Types:<\/strong> (Same as the color property \u2014 names, hex, rgb, rgba, hsl)<\/p>\n<p><strong>Example:<\/strong><\/p>\n<p style=\"text-align: center\"><em>div {<\/em><br \/>\n<em>background-color: lightblue;<\/em><br \/>\n<em>}<\/em><\/p>\n<p style=\"text-align: center\"><em>section {<\/em><br \/>\n<em>background-color: rgba(0, 128, 0, 0.3);<\/em><br \/>\n<em>}<\/em><\/p>\n<p><strong>Best Practice:<\/strong><\/p>\n<p>Use semi-transparent backgrounds (rgba) if you want backgrounds that allow layering effects without hiding everything underneath.<\/p>\n<p>For more on accessible color choices, see <a href=\"https:\/\/buhave.com\/courses\/css\/best-practices-and-optimization\/\" title=\"Best Practices and Optimization\">Best Practices and Optimization<\/a>.<\/p>\n<h3>3. background-image (Setting Images as Backgrounds)<\/h3>\n<p><strong>Definition:<\/strong><\/p>\n<p>The background-image property places an image behind the content of an HTML element.<\/p>\n<p><strong>Syntax:<\/strong><\/p>\n<p style=\"text-align: center\"><em>selector {<\/em><br \/>\n<em>background-image: url(&#8220;path-to-image&#8221;);<\/em><br \/>\n<em>}<\/em><\/p>\n<p><strong>Example:<\/strong><\/p>\n<p style=\"text-align: center\"><em>header {<\/em><br \/>\n<em>background-image: url(&#8216;banner.jpg&#8217;);<\/em><br \/>\n<em>}<\/em><\/p>\n<p><strong>Additional Properties for Better Control:<\/strong><\/p>\n<ul>\n<li>background-repeat: controls if\/how the background repeats (e.g., no-repeat, repeat-x, repeat-y).<\/li>\n<li>background-size: controls the size of the background image (e.g., cover, contain, specific sizes like 100px 200px).<\/li>\n<li>background-position: controls where the background image is positioned (e.g., center center, top right).<\/li>\n<\/ul>\n<p><strong>Complete Example:<\/strong><\/p>\n<p style=\"text-align: center\"><em>section {<\/em><br \/>\n<em>background-image: url(&#8216;background.jpg&#8217;);<\/em><br \/>\n<em>background-repeat: no-repeat;<\/em><br \/>\n<em>background-size: cover;<\/em><br \/>\n<em>background-position: center;<\/em><br \/>\n<em>}<\/em><\/p>\n<p><strong>Best Practice:<\/strong><\/p>\n<p>Optimize background images for web to reduce page load times (use compressed .jpg, .webp, or .avif formats).<\/p>\n<p><strong>Combined Example:<\/strong> Styling Text and Background Together<\/p>\n<p style=\"text-align: center\"><em>.hero-banner {<\/em><br \/>\n<em>color: white;<\/em><br \/>\n<em>background-color: #333;<\/em><br \/>\n<em>background-image: url(&#8216;hero.jpg&#8217;);<\/em><br \/>\n<em>background-size: cover;<\/em><br \/>\n<em>background-position: center;<\/em><br \/>\n<em>text-align: center;<\/em><br \/>\n<em>padding: 100px 20px;<\/em><br \/>\n<em>}<\/em><\/p>\n<p><strong>Explanation:<\/strong><\/p>\n<ul>\n<li>White text color on a dark background.<\/li>\n<li>A background image that covers the entire section without repeating.<\/li>\n<li>Centered text with spacious padding.<\/li>\n<\/ul>\n<p><strong>Summary Table:<\/strong><\/p>\n<p><strong>Summary Table:<\/strong><\/p>\n<table>\n<thead>\n<tr>\n<th>Property<\/th>\n<th>Purpose<\/th>\n<th>Example<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>color<\/td>\n<td>Sets text color<\/td>\n<td>color: #333;<\/td>\n<\/tr>\n<tr>\n<td>background-color<\/td>\n<td>Sets background color<\/td>\n<td>background-color: lightblue;<\/td>\n<\/tr>\n<tr>\n<td>background-image<\/td>\n<td>Adds an image as background<\/td>\n<td>background-image: url(&#8216;bg.jpg&#8217;);<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>Important Accessibility Note<\/strong><\/p>\n<ul>\n<li>Always maintain high contrast between text and background.<\/li>\n<li>Dark text on a light background or light text on a dark background improves readability.<\/li>\n<li>Tools like the WCAG Color Contrast Checker can help you design accessible websites.<\/li>\n<\/ul>\n<p><strong>Conclusion:<\/strong><\/p>\n<p>Using color, background-color, and background-image properly in CSS allows you to create visually engaging, readable, and aesthetically pleasing web pages. Combining colors smartly improves both user experience and design professionalism. For a broader view of CSS concepts, explore related topics like CSS Selectors and CSS Positioning.<\/p>\n<h2>Box model: margin, padding, border, and content areas<\/h2>\n<p>In CSS, every HTML element is treated as a rectangular box, and the box model describes how the size of that box is calculated and how its parts (content, padding, border, and margin) interact.<br \/>\nUnderstanding the box model is crucial for layout, spacing, and proper element alignment in web design.<\/p>\n<h3>1. Content Area<\/h3>\n<p><strong>Definition:<\/strong><\/p>\n<ul>\n<li>The content area is where text, images, or other child elements are displayed.<\/li>\n<\/ul>\n<p><strong>Key Points:<\/strong><\/p>\n<ul>\n<li>It\u2019s the innermost part of the box.<\/li>\n<li>Its size can be controlled using width and height properties.<\/li>\n<\/ul>\n<p><strong>Example:<\/strong><\/p>\n<p style=\"text-align: center\"><em>div {<\/em><br \/>\n<em>width: 200px;<\/em><br \/>\n<em>height: 100px;<\/em><br \/>\n<em>}<\/em><\/p>\n<ul>\n<li>This sets the content width to 200px and height to 100px (excluding padding, border, and margin).<\/li>\n<\/ul>\n<h3>2. Padding Area<\/h3>\n<p><strong>Definition:<\/strong><\/p>\n<p>Padding is the space between the content and the border. It pushes the border outward and adds extra space around the content.<\/p>\n<p><strong>Syntax:<\/strong><\/p>\n<p style=\"text-align: center\"><em>selector {<\/em><br \/>\n<em>padding: value;<\/em><br \/>\n<em>}<\/em><\/p>\n<p><strong>Example:<\/strong><\/p>\n<p style=\"text-align: center\"><em>div {<\/em><br \/>\n<em>padding: 20px;<\/em><br \/>\n<em>}<\/em><\/p>\n<ul>\n<li>Adds 20px of padding on all four sides (top, right, bottom, left) of the content.<\/li>\n<\/ul>\n<p><strong>Best Practice:<\/strong><\/p>\n<ul>\n<li>Use padding when you want to increase spacing inside the box without affecting the outer layout.<\/li>\n<\/ul>\n<p><strong>Individual sides can be controlled:<\/strong><\/p>\n<p style=\"text-align: center\"><em>padding-top: 10px;<\/em><br \/>\n<em>padding-right: 15px;<\/em><br \/>\n<em>padding-bottom: 20px;<\/em><br \/>\n<em>padding-left: 15px;<\/em><\/p>\n<h3>3. Border Area<\/h3>\n<p><strong>Definition:<\/strong><\/p>\n<ul>\n<li>The border wraps around the padding (if any) and content areas.<\/li>\n<\/ul>\n<p><strong>Syntax:<\/strong><\/p>\n<p style=\"text-align: center\"><em>selector {<\/em><br \/>\n<em>border: width style color;<\/em><br \/>\n<em>}<\/em><\/p>\n<p><strong>Example:<\/strong><\/p>\n<p style=\"text-align: center\"><em>div {<\/em><br \/>\n<em>border: 2px solid black;<\/em><br \/>\n<em>}<\/em><\/p>\n<ul>\n<li>Adds a solid black border that is 2px thick around the padding\/content.<\/li>\n<\/ul>\n<p><strong>Best Practice:<\/strong><\/p>\n<ul>\n<li>Borders are great for separating or highlighting sections of a webpage.<\/li>\n<\/ul>\n<p><strong>Border shorthand example:<\/strong><\/p>\n<p style=\"text-align: center\"><em>border: 1px dashed red;<\/em><\/p>\n<ul>\n<li>Creates a 1px thick, dashed red border.<\/li>\n<\/ul>\n<h3>4. Margin Area<\/h3>\n<p><strong>Definition:<\/strong><\/p>\n<p>Margin is the outermost space that separates the element from other elements.<br \/>\nIt creates space between different boxes on the page.<\/p>\n<p><strong>Syntax:<\/strong><\/p>\n<p style=\"text-align: center\"><em>selector {<\/em><br \/>\n<em>margin: value;<\/em><br \/>\n<em>}<\/em><\/p>\n<p><strong>Further details:<\/strong><\/p>\n<p>Margins can be specified for individual sides (margin-top, margin-right, margin-bottom, margin-left) to fine-tune external spacing.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Styling text: font-family, font-size, font-weight, text-align In CSS, styling text is one of the core parts of creating visually attractive [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":577,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[12],"tags":[],"class_list":["post-576","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-css"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Basic CSS Properties - CSS Course<\/title>\n<meta name=\"description\" content=\"CSS properties style, position, size, color, space, align, decorate, transform, animate, and structure HTML elements visually.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/buhave.com\/courses\/css\/basic-css-properties\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Basic CSS Properties - CSS Course\" \/>\n<meta property=\"og:description\" content=\"CSS properties style, position, size, color, space, align, decorate, transform, animate, and structure HTML elements visually.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/buhave.com\/courses\/css\/basic-css-properties\/\" \/>\n<meta property=\"og:site_name\" content=\"BUHAVE\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/BeYouHave\/\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/naveedsafdarawan\/\" \/>\n<meta property=\"article:published_time\" content=\"2025-05-19T10:47:10+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-06-06T13:19:21+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/buhave.com\/courses\/wp-content\/uploads\/2025\/04\/Basic-CSS-Properties.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"Naveed Safdar\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Naveed Safdar\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/css\\\/basic-css-properties\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/css\\\/basic-css-properties\\\/\"},\"author\":{\"name\":\"Naveed Safdar\",\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/#\\\/schema\\\/person\\\/04fe0254e118521c9fbb3da39de5acca\"},\"headline\":\"Basic CSS Properties\",\"datePublished\":\"2025-05-19T10:47:10+00:00\",\"dateModified\":\"2026-06-06T13:19:21+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/css\\\/basic-css-properties\\\/\"},\"wordCount\":1374,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/css\\\/basic-css-properties\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/buhave.com\\\/courses\\\/wp-content\\\/uploads\\\/2025\\\/04\\\/Basic-CSS-Properties.webp\",\"articleSection\":[\"CSS Course\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/buhave.com\\\/courses\\\/css\\\/basic-css-properties\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/css\\\/basic-css-properties\\\/\",\"url\":\"https:\\\/\\\/buhave.com\\\/courses\\\/css\\\/basic-css-properties\\\/\",\"name\":\"Basic CSS Properties - CSS Course\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/css\\\/basic-css-properties\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/css\\\/basic-css-properties\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/buhave.com\\\/courses\\\/wp-content\\\/uploads\\\/2025\\\/04\\\/Basic-CSS-Properties.webp\",\"datePublished\":\"2025-05-19T10:47:10+00:00\",\"dateModified\":\"2026-06-06T13:19:21+00:00\",\"description\":\"CSS properties style, position, size, color, space, align, decorate, transform, animate, and structure HTML elements visually.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/css\\\/basic-css-properties\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/buhave.com\\\/courses\\\/css\\\/basic-css-properties\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/css\\\/basic-css-properties\\\/#primaryimage\",\"url\":\"https:\\\/\\\/buhave.com\\\/courses\\\/wp-content\\\/uploads\\\/2025\\\/04\\\/Basic-CSS-Properties.webp\",\"contentUrl\":\"https:\\\/\\\/buhave.com\\\/courses\\\/wp-content\\\/uploads\\\/2025\\\/04\\\/Basic-CSS-Properties.webp\",\"width\":1200,\"height\":628,\"caption\":\"Basic CSS Properties\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/css\\\/basic-css-properties\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Courses\",\"item\":\"https:\\\/\\\/buhave.com\\\/courses\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"CSS Course\",\"item\":\"https:\\\/\\\/buhave.com\\\/courses\\\/learn\\\/css\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Basic CSS Properties\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/#website\",\"url\":\"https:\\\/\\\/buhave.com\\\/courses\\\/\",\"name\":\"BUHAVE\",\"description\":\"Courses - Learn Online for Free\",\"publisher\":{\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/buhave.com\\\/courses\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/#organization\",\"name\":\"BUHAVE\",\"url\":\"https:\\\/\\\/buhave.com\\\/courses\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/buhave.com\\\/courses\\\/wp-content\\\/uploads\\\/2025\\\/03\\\/buhave-course.webp\",\"contentUrl\":\"https:\\\/\\\/buhave.com\\\/courses\\\/wp-content\\\/uploads\\\/2025\\\/03\\\/buhave-course.webp\",\"width\":375,\"height\":75,\"caption\":\"BUHAVE\"},\"image\":{\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/BeYouHave\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/buhave\",\"https:\\\/\\\/www.youtube.com\\\/@buhave\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/#\\\/schema\\\/person\\\/04fe0254e118521c9fbb3da39de5acca\",\"name\":\"Naveed Safdar\",\"description\":\"I\u2019m Naveed Safdar - SEO Manager with over 10 years of experience in SEO and Digital Marketing. I\u2019ve had the privilege of working with leading national and international companies including Grafdom, PakWheels, Systems Limited, Confiz, Educative, and Dubizzle Labs. My expertise spans technical SEO, content strategy, organic growth, and performance analytics - helping businesses improve visibility, traffic, and ROI.\",\"sameAs\":[\"https:\\\/\\\/www.linkedin.com\\\/in\\\/naveedsafdar\\\/\",\"https:\\\/\\\/www.facebook.com\\\/naveedsafdarawan\\\/\",\"https:\\\/\\\/www.youtube.com\\\/@naveedsafdar\"],\"url\":\"https:\\\/\\\/buhave.com\\\/courses\\\/author\\\/naveed-safdar\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Basic CSS Properties - CSS Course","description":"CSS properties style, position, size, color, space, align, decorate, transform, animate, and structure HTML elements visually.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/buhave.com\/courses\/css\/basic-css-properties\/","og_locale":"en_US","og_type":"article","og_title":"Basic CSS Properties - CSS Course","og_description":"CSS properties style, position, size, color, space, align, decorate, transform, animate, and structure HTML elements visually.","og_url":"https:\/\/buhave.com\/courses\/css\/basic-css-properties\/","og_site_name":"BUHAVE","article_publisher":"https:\/\/www.facebook.com\/BeYouHave\/","article_author":"https:\/\/www.facebook.com\/naveedsafdarawan\/","article_published_time":"2025-05-19T10:47:10+00:00","article_modified_time":"2026-06-06T13:19:21+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/buhave.com\/courses\/wp-content\/uploads\/2025\/04\/Basic-CSS-Properties.webp","type":"image\/webp"}],"author":"Naveed Safdar","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Naveed Safdar","Est. reading time":"10 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/buhave.com\/courses\/css\/basic-css-properties\/#article","isPartOf":{"@id":"https:\/\/buhave.com\/courses\/css\/basic-css-properties\/"},"author":{"name":"Naveed Safdar","@id":"https:\/\/buhave.com\/courses\/#\/schema\/person\/04fe0254e118521c9fbb3da39de5acca"},"headline":"Basic CSS Properties","datePublished":"2025-05-19T10:47:10+00:00","dateModified":"2026-06-06T13:19:21+00:00","mainEntityOfPage":{"@id":"https:\/\/buhave.com\/courses\/css\/basic-css-properties\/"},"wordCount":1374,"commentCount":0,"publisher":{"@id":"https:\/\/buhave.com\/courses\/#organization"},"image":{"@id":"https:\/\/buhave.com\/courses\/css\/basic-css-properties\/#primaryimage"},"thumbnailUrl":"https:\/\/buhave.com\/courses\/wp-content\/uploads\/2025\/04\/Basic-CSS-Properties.webp","articleSection":["CSS Course"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/buhave.com\/courses\/css\/basic-css-properties\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/buhave.com\/courses\/css\/basic-css-properties\/","url":"https:\/\/buhave.com\/courses\/css\/basic-css-properties\/","name":"Basic CSS Properties - CSS Course","isPartOf":{"@id":"https:\/\/buhave.com\/courses\/#website"},"primaryImageOfPage":{"@id":"https:\/\/buhave.com\/courses\/css\/basic-css-properties\/#primaryimage"},"image":{"@id":"https:\/\/buhave.com\/courses\/css\/basic-css-properties\/#primaryimage"},"thumbnailUrl":"https:\/\/buhave.com\/courses\/wp-content\/uploads\/2025\/04\/Basic-CSS-Properties.webp","datePublished":"2025-05-19T10:47:10+00:00","dateModified":"2026-06-06T13:19:21+00:00","description":"CSS properties style, position, size, color, space, align, decorate, transform, animate, and structure HTML elements visually.","breadcrumb":{"@id":"https:\/\/buhave.com\/courses\/css\/basic-css-properties\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/buhave.com\/courses\/css\/basic-css-properties\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/buhave.com\/courses\/css\/basic-css-properties\/#primaryimage","url":"https:\/\/buhave.com\/courses\/wp-content\/uploads\/2025\/04\/Basic-CSS-Properties.webp","contentUrl":"https:\/\/buhave.com\/courses\/wp-content\/uploads\/2025\/04\/Basic-CSS-Properties.webp","width":1200,"height":628,"caption":"Basic CSS Properties"},{"@type":"BreadcrumbList","@id":"https:\/\/buhave.com\/courses\/css\/basic-css-properties\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Courses","item":"https:\/\/buhave.com\/courses\/"},{"@type":"ListItem","position":2,"name":"CSS Course","item":"https:\/\/buhave.com\/courses\/learn\/css\/"},{"@type":"ListItem","position":3,"name":"Basic CSS Properties"}]},{"@type":"WebSite","@id":"https:\/\/buhave.com\/courses\/#website","url":"https:\/\/buhave.com\/courses\/","name":"BUHAVE","description":"Courses - Learn Online for Free","publisher":{"@id":"https:\/\/buhave.com\/courses\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/buhave.com\/courses\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/buhave.com\/courses\/#organization","name":"BUHAVE","url":"https:\/\/buhave.com\/courses\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/buhave.com\/courses\/#\/schema\/logo\/image\/","url":"https:\/\/buhave.com\/courses\/wp-content\/uploads\/2025\/03\/buhave-course.webp","contentUrl":"https:\/\/buhave.com\/courses\/wp-content\/uploads\/2025\/03\/buhave-course.webp","width":375,"height":75,"caption":"BUHAVE"},"image":{"@id":"https:\/\/buhave.com\/courses\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/BeYouHave\/","https:\/\/www.linkedin.com\/company\/buhave","https:\/\/www.youtube.com\/@buhave"]},{"@type":"Person","@id":"https:\/\/buhave.com\/courses\/#\/schema\/person\/04fe0254e118521c9fbb3da39de5acca","name":"Naveed Safdar","description":"I\u2019m Naveed Safdar - SEO Manager with over 10 years of experience in SEO and Digital Marketing. I\u2019ve had the privilege of working with leading national and international companies including Grafdom, PakWheels, Systems Limited, Confiz, Educative, and Dubizzle Labs. My expertise spans technical SEO, content strategy, organic growth, and performance analytics - helping businesses improve visibility, traffic, and ROI.","sameAs":["https:\/\/www.linkedin.com\/in\/naveedsafdar\/","https:\/\/www.facebook.com\/naveedsafdarawan\/","https:\/\/www.youtube.com\/@naveedsafdar"],"url":"https:\/\/buhave.com\/courses\/author\/naveed-safdar\/"}]}},"_links":{"self":[{"href":"https:\/\/buhave.com\/courses\/wp-json\/wp\/v2\/posts\/576","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/buhave.com\/courses\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/buhave.com\/courses\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/buhave.com\/courses\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/buhave.com\/courses\/wp-json\/wp\/v2\/comments?post=576"}],"version-history":[{"count":2,"href":"https:\/\/buhave.com\/courses\/wp-json\/wp\/v2\/posts\/576\/revisions"}],"predecessor-version":[{"id":1151,"href":"https:\/\/buhave.com\/courses\/wp-json\/wp\/v2\/posts\/576\/revisions\/1151"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/buhave.com\/courses\/wp-json\/wp\/v2\/media\/577"}],"wp:attachment":[{"href":"https:\/\/buhave.com\/courses\/wp-json\/wp\/v2\/media?parent=576"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/buhave.com\/courses\/wp-json\/wp\/v2\/categories?post=576"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/buhave.com\/courses\/wp-json\/wp\/v2\/tags?post=576"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}