HomeОбразованиеRelated VideosMore From: ProWeb Tutorials

Understanding Margins In CSS

18 ratings | 528 views
Hello Friends! In this tutorial I will teach you what is a margin in CSS and what are its properties and values. This tutorial is in Urdu/Hindi. CSS Margin is the space (area) around any HTML element outside of its border. We can set margin of any element respective to its four sides like top, right, bottom and left. If you assume any HTML element as a box or a rectangle that each element has four sides. We can set margin through CSS for its four sides or individually to the side specified in the parameter. Simple syntax of a margin includes the parameters such as length, percentage, auto, initial and inherit. We can give or set margin as a length in pixel or we can set as a percentage. The auto value set the element margin automatically by the browser. Auto value is very important in CSS in many situations we want an element to be center to the page so that by specifying margin to auto and give an element a specific width the element should be center to the browser window and auto divide the rest of space to equal margins from left and right side. In this way any element can be centered by setting margin value to auto and give an element the width. The initial value in margin is also very important so that it will set the element properties to its default value and override the styling given by explicitly. The inherit property in margin sets the properties to its parent element. We can set margin in CSS to all sides of an element or we can set margin in CSS to its individual side of an element. For this CSS provide us some properties such as margin-top, margin-right, margin-bottom and margin-left. By using these properties we can set any element margin to its specific side For example if you want to set top margin of an element only you would write simply margin-top and give its value in pixels. Similarly you can set margin bottom as specifying margin-bottom property and give its value in pixel. I hope that you would like this tutorial. Thanks for watching.
Html code for embedding videos on your blog
Text Comments (12)
jkjd (6 months ago)
sir,pls make some more videos on css .....
ProWeb Tutorials (6 months ago)
Thanks for taking interest in my Channel....I will start soon........
atif ahmed (6 months ago)
good
HUMAYHOUN ADEEL (6 months ago)
nice
learning skills (7 months ago)
bro create a responsive layout by using float techniques ..You can create layout in css plz
ProWeb Tutorials (7 months ago)
Oh then I'll try it when I have some time... Thnx 4 ur interest :)
learning skills (7 months ago)
what if our customer wants to create a website in custom css?
ProWeb Tutorials (7 months ago)
Thanks Bro for ur comment....But I am planning to make a tutorial on Bootstrap for this purpose soon...
SAHIL S (8 months ago)
Knowledgeable keep it up
ProWeb Tutorials (8 months ago)
Thanks
sajeel ahmad (8 months ago)
Nice Tutorial
Full Of Entertainment (8 months ago)
very nice pls make PHP tutorials

Would you like to comment?

Join YouTube for a free account, or sign in if you are already a member.