Mistaken CSS

This is a post for all the people that are new to css and are maybe having some troubles understanding it. One of the biggest things I had a problem with when I started css was understanding the difference between internal css, inline css, and a style sheet. Some of the things that I had a problem with consisted of.

What is the difference of the three?
Why would I use one over the others?
What is the format for each?

Well I want to touch on these topics a little. First what is the difference of the two? Well the biggest difference between the three is that two are in the HTML document and the other is a external document. The names of each kind should tell what they are the inline and internal are in the HTML document and the style sheet is not.

The second question is why would I use one over the others? The answer for this question is that you really don’t have to chose between the three choices. The only thing that will help is if you use a style sheet it makes your HTML document much more organized. I personally don’t use inline or internal css unless I absolutely have to.

The Third question is what is the format for each? This is a big question because the three do look different. When you are using the inline code it should look something like this-

And last when you are using the style sheet form it gets a little tricky first you have to link a style sheet to the HTML page by using
this is saying that you have a css file named style.css in the root directory. Now you have to create a file called style.css in the root directory. Inside this document is where your code goes which will look something like this-

hr {color: sienna}
p {margin-left: 20px}
body {background-image: url(“images/back40.gif”)}

Now if you have something like you want a padding and a margin on your paragraph(p) tag all you have to do is p {margin-left: 20px; padding: 2px;}. A really good thing to practice is if you have something that has something like 5 or above attributes about it it is good to code them like this-
p {
margin-left: 20px;
padding: 2px;
width: 100px;
z-index: 2;
height: 75px;

With that last thing I believe that you are ready to start coding in CSS and you will have a better understanding of what the code should look like.

Shane Strong
Chosen Development

About Shane

Hi I am Shane the main author of this blog. I am a self taught web developer. I have been working in this industry since 2008. I work a lot with WordPress, Magento, SEO & SEM, and custom built websites. I love all sports and I will try anything at least twice.

Working remotely is one of the fastest growing perks in the working world. It’s something that people talk about a lot, and it’s a solution to the “work/life balance” problem that bothers so many people. Most of us have asked the question, “Why do I work so hard?” For some people, there are many sides

Know little about the use of keylogger for Android? Wondering why so many friends choose free Android spy? What benefits can you get from tracking cell phones of your children and employees with the help of sms tracker? Keep reading and find the answers in this short article. Have you ever dreamed of taking control

As a photographer whether it be a hobby or on a professional level the realm of high dynamic range photography can be very troublesome without photo editing software specifically made for photo HDR. Aurora HDR photography can be very challenging as it is, but with Aurora the job gets a little bit easier. Some might