HomeОбразованиеRelated VideosMore From: Ankpro Training

CSS Lesson 5 - CSS Borders, Margin and Padding

2 ratings | 971 views
CSS Borders: CSS attribute, allow you to completely customize the borders that appear around HTML elements. With HTML, it used to be impossible to place a border around an element, except for the table. Border-style Border-width Border-color Border Styles: The border-style property specifies what kind of border to display. The following values are allowed: dotted  dashed  solid  double  groove  ridge inset  outset  none  hidden  Border-color: You customize the Border colors using css property called border-color. Margins: A margin defines the white space around an HTML element's border. CSS has properties for specifying the margin for each side of an element: margin-top margin-right margin-bottom margin-left All the margin properties can have the following values: auto - the browser calculates the margin length - specifies a margin in px, pt, cm, etc. inherit - specifies that the margin should be inherited from the parent element. CSS Padding:: A padding is the space between an element's border and the content within it. Padding - Individual Sides:- CSS has properties for specifying the padding for each side of an element: padding-top padding-right padding-bottom padding-left All the padding properties can have the following values: length - specifies a padding in px, pt, cm, etc. inherit - specifies that the padding should be inherited from the parent element CSS Height and Width: The Height and width properties are used to set the height and width of an element. Setting the width of a block-level element will prevent it from stretching out to the edges of its container.  max-width:-By using this Css property we can set max width of the element. ankpro ankpro training Asp.net MVC C# C sharp Bangalore Rajajinagar Selenium Coded UI Mobile automation testing Mobile testing JQuery JavaScript .Net
Html code for embedding videos on your blog
Text Comments (4)
white hat (1 year ago)
pls help me table{width:100px; height:50px; --->how about boder top: 2px black; and boder bottom: 2px black;} +to make result home in google crome thank you --->im from viet nam
Ankpro Training (1 year ago)
border-top: 2px solid black; border-bottom: 2px solid black; Try the above code and let me know. Subscribe to our channel to get the updates on the video we share. If you like our videos, share them in the facebook, twitter and whatsapp.
john smith (1 year ago)
How could I change my margin to a custom color like #948C96?
Ankpro Training (1 year ago)
You can not have a color for margin instead try .thick-border { border : 10px solid #948C96; }

Would you like to comment?

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