{"id":576,"date":"2025-05-19T10:47:10","date_gmt":"2025-05-19T10:47:10","guid":{"rendered":"https:\/\/buhave.com\/courses\/?p=576"},"modified":"2025-05-20T12:57:38","modified_gmt":"2025-05-20T12:57:38","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.<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<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<\/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.<\/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.<\/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.<\/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<table>\n<caption><strong>Summary Table:<\/strong><\/caption>\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.<\/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<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<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.<\/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>Example:<\/strong><\/p>\n<p style=\"text-align: center\"><em>div {<\/em><br \/>\n<em>margin: 30px;<\/em><br \/>\n<em>}<\/em><\/p>\n<ul>\n<li>Adds 30px of space around the entire box.<\/li>\n<\/ul>\n<p><strong>Best Practice:<\/strong><\/p>\n<ul>\n<li>Use margin to position elements by creating space between them.<\/li>\n<\/ul>\n<p><strong>Individual sides can be controlled:<\/strong><\/p>\n<p style=\"text-align: center\"><em>margin-top: 20px;<\/em><br \/>\n<em>margin-right: 15px;<\/em><br \/>\n<em>margin-bottom: 25px;<\/em><br \/>\n<em>margin-left: 10px;<\/em><\/p>\n<p><strong>Visual Structure of the Box Model:<\/strong><\/p>\n<p style=\"text-align: center\"><em>+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+<\/em><br \/>\n<em>| Margin |<\/em><br \/>\n<em>| +&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+ |<\/em><br \/>\n<em>| | Border | |<\/em><br \/>\n<em>| | +&#8212;&#8212;&#8212;&#8212;&#8212;+ | |<\/em><br \/>\n<em>| | | Padding | | |<\/em><br \/>\n<em>| | | +&#8212;&#8212;&#8212;&#8211;+ | | |<\/em><br \/>\n<em>| | | | Content | | | |<\/em><br \/>\n<em>| | | +&#8212;&#8212;&#8212;&#8211;+ | | |<\/em><br \/>\n<em>| | +&#8212;&#8212;&#8212;&#8212;&#8212;+ | |<\/em><br \/>\n<em>| +&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+ |<\/em><br \/>\n<em>+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+<\/em><\/p>\n<p><strong>Example:<\/strong> Full Box Model Code<\/p>\n<p style=\"text-align: center\"><em>.box {<\/em><br \/>\n<em>width: 300px;<\/em><br \/>\n<em>height: 150px;<\/em><br \/>\n<em>padding: 20px;<\/em><br \/>\n<em>border: 5px solid blue;<\/em><br \/>\n<em>margin: 30px;<\/em><br \/>\n<em>background-color: lightgray;<\/em><br \/>\n<em>}<\/em><\/p>\n<p><strong>Explanation:<\/strong><\/p>\n<ul>\n<li>Content area: 300px x 150px<\/li>\n<li>Padding: 20px on each side (increases total visual space)<\/li>\n<li>Border: 5px thick<\/li>\n<li>Margin: 30px space around the outside of the box<\/li>\n<\/ul>\n<p><strong>Box Sizing: How Total Size is Calculated:<\/strong><\/p>\n<p><strong>Default Behavior:<\/strong><\/p>\n<p>By default (box-sizing: content-box), the width and height only apply to the content. Padding and border are added outside of it, increasing the total size.<\/p>\n<p><strong>Example:<\/strong><\/p>\n<ul>\n<li>width: 300px<\/li>\n<li>padding: 20px<\/li>\n<li>border: 5px<\/li>\n<\/ul>\n<p>Total Width = 300 + (20 \u00d7 2) + (5 \u00d7 2) = 350px<br \/>\nTotal Height = height + padding + border (similar calculation)<\/p>\n<p><strong>Tip:<\/strong><\/p>\n<p>Use box-sizing: border-box; to make width\/height include padding and border inside the defined size.<\/p>\n<p style=\"text-align: center\"><em>* {<\/em><br \/>\n<em>box-sizing: border-box;<\/em><br \/>\n<em>}<\/em><\/p>\n<ul>\n<li>This makes layouts much easier to manage.<\/li>\n<\/ul>\n<p><strong>Summary Table:<\/strong><\/p>\n<table class=\"box-model-table\">\n<caption><strong>Summary Table<\/strong><\/caption>\n<thead>\n<tr>\n<th>Box Part<\/th>\n<th>Purpose<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Content<\/td>\n<td>Holds text, images, or other elements<\/td>\n<\/tr>\n<tr>\n<td>Padding<\/td>\n<td>Space between content and border<\/td>\n<\/tr>\n<tr>\n<td>Border<\/td>\n<td>Surrounds padding and content<\/td>\n<\/tr>\n<tr>\n<td>Margin<\/td>\n<td>Space between elements outside the border<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>Conclusion:<\/strong><\/p>\n<p>The CSS Box Model is foundational for building and styling web layouts. Mastering margin, padding, border, and content areas ensures you have precise control over element size, spacing, and positioning on the page.<\/p>\n<h2>Working with images: width, height, object-fit<\/h2>\n<p>When adding images to a webpage, controlling their size and appearance is crucial for maintaining a clean, responsive, and visually balanced design.<br \/>\nCSS properties like width, height, and object-fit allow you to scale, resize, and fit images properly without distortion.<\/p>\n<h3>1. width and height (Setting Image Dimensions)<\/h3>\n<p><strong>Definition:<\/strong><\/p>\n<p>The width and height properties define the dimensions of an image element.<\/p>\n<p><strong>Syntax:<\/strong><\/p>\n<p style=\"text-align: center\"><em>selector {<\/em><br \/>\n<em>width: value;<\/em><br \/>\n<em>height: value;<\/em><br \/>\n<em>}<\/em><\/p>\n<p><strong>Value Types:<\/strong><\/p>\n<ul>\n<li>Fixed units (e.g., px, em)<\/li>\n<li>Relative units (e.g., %, vw, vh)<\/li>\n<\/ul>\n<p><strong>Example:<\/strong> Setting Fixed Width and Height<\/p>\n<p style=\"text-align: center\"><em>img {<\/em><br \/>\n<em>width: 300px;<\/em><br \/>\n<em>height: 200px;<\/em><br \/>\n<em>}<\/em><\/p>\n<ul>\n<li>This sets the image to exactly 300px wide and 200px tall.<\/li>\n<\/ul>\n<p><strong>Tip:<\/strong><\/p>\n<p>When setting only width or height, the browser automatically maintains the aspect ratio (original proportions) unless you set both, which might cause distortion.<\/p>\n<p><strong>Example:<\/strong> Responsive Image<\/p>\n<p style=\"text-align: center\"><em>img {<\/em><br \/>\n<em>width: 100%;<\/em><br \/>\n<em>height: auto;<\/em><br \/>\n<em>}<\/em><\/p>\n<ul>\n<li>The image stretches to fill the width of its parent container while keeping its natural height proportionate.<\/li>\n<\/ul>\n<p><strong>Best Practice:<\/strong><\/p>\n<p>Use width: 100% and height: auto for responsive designs so that images adjust gracefully across devices.<\/p>\n<h3>2. object-fit (Controlling How the Image Fills Its Container)<\/h3>\n<p><strong>Definition:<\/strong><\/p>\n<p>The object-fit property specifies how an image (or video) should be resized to fit its container box.<\/p>\n<p><strong>Syntax:<\/strong><\/p>\n<p style=\"text-align: center\"><em>selector {<\/em><br \/>\n<em>object-fit: value;<\/em><br \/>\n<em>}<\/em><\/p>\n<p><strong>Available Values:<\/strong><\/p>\n<ul>\n<li>fill \u2014 stretches the image to fill the container (may distort).<\/li>\n<li>contain \u2014 fits the entire image inside the container (no distortion, may leave empty space).<\/li>\n<li>cover \u2014 fills the container, cropping the image if necessary (no distortion).<\/li>\n<li>none \u2014 keeps original size, no scaling.<\/li>\n<li>scale-down \u2014 acts like none or contain, whichever is smaller.<\/li>\n<\/ul>\n<p><strong>Examples:<\/strong><\/p>\n<p><strong>Fill the container (might distort):<\/strong><\/p>\n<p style=\"text-align: center\"><em>img {<\/em><br \/>\n<em>width: 400px;<\/em><br \/>\n<em>height: 300px;<\/em><br \/>\n<em>object-fit: fill;<\/em><br \/>\n<em>}<\/em><\/p>\n<p><strong>Fit the image without cutting (contain):<\/strong><\/p>\n<p style=\"text-align: center\"><em>img {<\/em><br \/>\n<em>width: 400px;<\/em><br \/>\n<em>height: 300px;<\/em><br \/>\n<em>object-fit: contain;<\/em><br \/>\n<em>}<\/em><\/p>\n<p><strong>Fill the container completely and crop excess (cover):<\/strong><\/p>\n<p style=\"text-align: center\"><em>img {<\/em><br \/>\n<em>width: 400px;<\/em><br \/>\n<em>height: 300px;<\/em><br \/>\n<em>object-fit: cover;<\/em><br \/>\n<em>}<\/em><\/p>\n<ul>\n<li>This is great for profile pictures, banners, or galleries where the aspect ratio must be preserved but empty space is not desired.<\/li>\n<\/ul>\n<p><strong>Best Practice:<\/strong><\/p>\n<p>object-fit: cover; is widely used for background images, profile avatars, and any case where you want the image to fill a specific frame without distortion.<\/p>\n<h3>3. Complete Working Example<\/h3>\n<p style=\"text-align: center\"><em>&lt;!DOCTYPE html&gt;<\/em><br \/>\n<em>&lt;html lang=&#8221;en&#8221;&gt;<\/em><br \/>\n<em>&lt;head&gt;<\/em><br \/>\n<em>&lt;meta charset=&#8221;UTF-8&#8243;&gt;<\/em><br \/>\n<em>&lt;title&gt;Image Styling Example&lt;\/title&gt;<\/em><br \/>\n<em>&lt;style&gt;<\/em><br \/>\n<em>.responsive-image {<\/em><br \/>\n<em>width: 100%;<\/em><br \/>\n<em>height: auto;<\/em><br \/>\n<em>}<\/em><\/p>\n<p style=\"text-align: center\"><em>.cover-image {<\/em><br \/>\n<em>width: 300px;<\/em><br \/>\n<em>height: 200px;<\/em><br \/>\n<em>object-fit: cover;<\/em><br \/>\n<em>border: 2px solid #333;<\/em><br \/>\n<em>}<\/em><\/p>\n<p style=\"text-align: center\"><em>.contain-image {<\/em><br \/>\n<em>width: 300px;<\/em><br \/>\n<em>height: 200px;<\/em><br \/>\n<em>object-fit: contain;<\/em><br \/>\n<em>border: 2px dashed #666;<\/em><br \/>\n<em>background: #f0f0f0;<\/em><br \/>\n<em>}<\/em><br \/>\n<em>&lt;\/style&gt;<\/em><br \/>\n<em>&lt;\/head&gt;<\/em><br \/>\n<em>&lt;body&gt;<\/em><\/p>\n<p style=\"text-align: center\"><em>&lt;h2&gt;Responsive Image&lt;\/h2&gt;<\/em><br \/>\n<em>&lt;img src=&#8221;your-image.jpg&#8221; class=&#8221;responsive-image&#8221; alt=&#8221;Responsive Example&#8221;&gt;<\/em><\/p>\n<p style=\"text-align: center\"><em>&lt;h2&gt;Cover Image&lt;\/h2&gt;<\/em><br \/>\n<em>&lt;img src=&#8221;your-image.jpg&#8221; class=&#8221;cover-image&#8221; alt=&#8221;Cover Example&#8221;&gt;<\/em><\/p>\n<p style=\"text-align: center\"><em>&lt;h2&gt;Contain Image&lt;\/h2&gt;<\/em><br \/>\n<em>&lt;img src=&#8221;your-image.jpg&#8221; class=&#8221;contain-image&#8221; alt=&#8221;Contain Example&#8221;&gt;<\/em><\/p>\n<p style=\"text-align: center\"><em>&lt;\/body&gt;<\/em><br \/>\n<em>&lt;\/html&gt;<\/em><\/p>\n<p><strong>Summary Table:<\/strong><\/p>\n<table class=\"image-sizing-table\">\n<caption><strong>Summary Table<\/strong><\/caption>\n<thead>\n<tr>\n<th>Property<\/th>\n<th>Purpose<\/th>\n<th>Example Usage<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><span class=\"property-name\">width<\/span><\/td>\n<td>Sets the image width<\/td>\n<td><span class=\"code-example\">width: 300px;<\/span> or <span class=\"code-example\">width: 100%;<\/span><\/td>\n<\/tr>\n<tr>\n<td><span class=\"property-name\">height<\/span><\/td>\n<td>Sets the image height<\/td>\n<td><span class=\"code-example\">height: auto;<\/span> or <span class=\"code-example\">height: 200px;<\/span><\/td>\n<\/tr>\n<tr>\n<td><span class=\"property-name\">object-fit<\/span><\/td>\n<td>Controls how image fits container<\/td>\n<td><span class=\"code-example\">object-fit: cover;<\/span>, <span class=\"code-example\">contain;<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>Conclusion:<\/strong><\/p>\n<p>By mastering width, height, and object-fit, you can make sure your images fit beautifully into your layouts, remain responsive across devices, and maintain their visual integrity \u2014 crucial for professional, modern web design.<\/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 and readable web pages. The main properties used for text styling include font-family, font-size, font-weight, and text-align. Each controls a different aspect of how text<\/p>\n","protected":false},"author":1,"featured_media":577,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"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.3 - 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=\"2025-05-20T12:57:38+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\":\"2025-05-20T12:57:38+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/css\\\/basic-css-properties\\\/\"},\"wordCount\":1974,\"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\":\"2025-05-20T12:57:38+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":"2025-05-20T12:57:38+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":"2025-05-20T12:57:38+00:00","mainEntityOfPage":{"@id":"https:\/\/buhave.com\/courses\/css\/basic-css-properties\/"},"wordCount":1974,"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":"2025-05-20T12:57:38+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":1,"href":"https:\/\/buhave.com\/courses\/wp-json\/wp\/v2\/posts\/576\/revisions"}],"predecessor-version":[{"id":578,"href":"https:\/\/buhave.com\/courses\/wp-json\/wp\/v2\/posts\/576\/revisions\/578"}],"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}]}}