Written by
Daniel Likin
Hi bloggy readers,
It seems interesting to learn how CSS style (IDs, classes, properties, and values) can actually work like a magic if we know how to use it properly in the field of HTML programming. And as a serious blogger, we must have the ability to understand how to work with CSS codes. Even though your blog topic is about cooking, fishing, or anything outside blogging or web designing, it's a must for you to be familiar with CSS and HTML language. So now, let's learn how to be familiar with CSS code in the simple way, so in the future it may come in handy for your blogging experience.
CSS languages are considerably wide and big if it refer to the uses of IDs, classes, properties and values to control every element in your blog layout. That's why in this post, i want to narrow down the topic about CSS codes and just focusing on the main topics about:
- Border
- Margin
- Padding
What Exactly is CSS and the history behind it?
CSS which stands for Cascading Style Sheets, can be defined as a pack of commands (IDs, classes, properties and values) written in mark up language, which is created to differ one element from another elements (fonts, layout, etc) in particular styles.
Used to be, when static websites are popularly utilized to create web pages around internet, the use of CSS hasn't been utilized yet on those websites. As a time passed, and the world of internet is becoming bigger and bigger over the time, many website owners begin to realize the importance of using CSS to control every page on their websites with one simple command, the CSS itself, without being bothered to create the style for every page on their websites, which can be exhausting to do.
And there comes a blog, which i can describe as the revolutionized version of website. Now by adding only one CSS style for your blog, every page of your blog, from the homepage and article pages, can be easily controlled using the CSS.
How to Create CSS for ID or class?
For example, if i want to make a pack of commands or CSS that will control the appearance of post title, say, i would name it as post-title. So the anchor or class of the CSS should be written like this:
.post-title {
}
}
And then, i want to set the particular styles for my post title. The following properties (e.g., color, font-weight, background, etc) are the pack of commands which i want to add to the post-title.
.post-title {
color:black;
font-weight:bold;
background:white;
font-size:19px;
}For example, now look at the div class tag to make the CSS class above (post-title) appear in our blog:
<div class="posttitle">
As you can see in that code above, the "Element" has been wrapped up by using the 2 line div class codes in order to apply the CSS class in the web page. Element
</div>What are Border, Padding and Margin in CSS style?
Okay, now proceed to the next part of this tutorial, i will explain to you about what is padding, border and margin in CSS programming?.
Border
Border is a part of CSS language that can be used to make a line border around the corner of the element/column. Now look at the picture below regarding the types of border that can be applied to the CSS command.
![]() |
| Types of borders |
border:1px solid #696969
As you can see in the code above, - 1px indicates the tickness of the line.
- Solid indicates what type of line border that will appear. The value "solid" can be replaced with "dotted" or "dashed".
- #696969 indicates the code of the line color. The value #696969 cannot be replaced with the word, say, white or black.
Padding is a part of properties from CSS language that can be utilized to make a space around and inside the element. For example, now i make a column for the Recent Post widget. And then, i want to create a space around that element, so the content inside, all the last comments, won't collide to the corners of the column, so that can be read easily. For example, take a look at the picture below!
By adding the property and value, padding:10px (for example) inside the CSS command area, you will create a 10 pixel space inside the element. By adding the property left besides the padding property, for example: padding-left:10px, you will create a space only on the left area inside the element.
Margin
Margin is the part of CSS language property that can be used to create a space outside the element. Unlike padding, margin will allow us to make a space outside the element, not inside the element. See the example through the picture below! As you can see in that picture above, margin will create an extra space in order to separate on element to the other element, in this case, to separate the Recent Post widget from colliding with the Recent Post widget. By adding the property margin:10px inside the CSS area, i will create a 10 pixel space outside the element.
Similar with the padding command, by adding the specific property left besides the margin property, for example, margin-left:10px, i am about to create a 10 pixel space only on the left side of element.
Okay, that's little about CSS tutorial that i can share to you right now. Next time, i will digg more about CSS for you. Thanks for reading this article. If you feel this article helps you understand what CSS really is, feel free to share this article to your friends or family around the Twitter land or Facebook pages.
Related Posts :
Share This Article to Other People Across the World !
Thanks!
Get the fresh update from Whatmakesblog.com!
To get updates from this blog, just enter your email address in the below subscription form and then click Subscribe.
Your email address will not be shared to any third party
Delivered by FeedBurner








1 comments:
thanks..
Post a Comment