By BoLOBOSE payday loan

Intro to HTML: CSS Creating a Style Sheet

CSS stands for cascading style sheet, this is the document that will contain all of the information required to make your site look more appealing to the people reading it. Some of the things that CSS files can do are as follows: give areas of the page or the page a background, change the font and font color, and manage placement of div tags. Take note that the page created in this example is going to be very ugly and its sole purpose is to give you a better understanding as to how CSS works.

For the following we are going to use this as a layout and I would recommend that you use it as a base structure that you can build your site upon for the duration of this article.

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml”>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″ />
<title>Untitled Document</title>
<link href=”style.css” rel=”stylesheet” type=”text/css” />
</head>

<body>
<div id=”container”>
<div id=”header”>
<h1>Code With Design</h1>
</div>
<div id=”sidebar1″>
<h3>navigation</h3>
<p>navigation links coming in another tutorial.</p>
</div>
<div id=”mainContent”>
<h1> Header 1</h1>
<p>Paragraph text.</p>
</div>
<br />
<div id=”footer”>
<p>Code With Design</p>
</div>

</div>
</body>
</html>

On this page we are going to work with styling the div tags. If you look at the code you will notice that the tags aren’t just a simple open and closing tag. These look differently because the div tags are named. This is important because the style.css file needs to know what to do with the separate content.

<div id=”footer”>

You are also going to notice that in the head of the file there is a link to the style sheet. If you where to put your pages into a separate folder you would have to change the link because it is relative. You can also call on it through a URL.

<link href=”style.css” rel=”stylesheet” type=”text/css” />

If you need to push the link back use ../ before style.css

<link href=”../style.css” rel=”stylesheet” type=”text/css” />

Now that we have gone over how to properly link to a style sheet it is time to take a look at what an actual style sheet. The beginning of a style sheet will contain some simple code then will start to stylize the body. All of the content within the style.css sheet will be named as divs and other parts of content such as p for paragraph or hover for content with a mouse over. The attributes that go with these separate sections are placed within curly bracers.

@charset “utf-8″;
body  {
font: 100% Verdana, Arial, Helvetica, sans-serif;
background: #ffffff;
margin: 0;
padding: 0;
text-align: center;
color: #000000;
}
#container {
width: 900px;
background: #FFFFFF;
margin: 0 auto;
text-align: left;
}
#header {
background: #ffffff;
padding: 0 10px 0 20px;
}
#header h1 {
margin: 0;
padding: 10px 0;
}
#sidebar1 {
float: right;
width: 200px;
background: #ffffff;
padding: 15px 10px;
}
#mainContent {
margin: 0 250px 0 0;
padding: 0 20px;
}
#footer {
padding: 0 10px 0 20px;
background:#ffffff;
}
#footer p {
margin: 0;
padding: 10px 0;
}
.fltrt {
float: right;
margin-left: 8px;
}
.fltlft {
float: left;
margin-right: 8px;
}
.clearfloat {
clear:both;
height:0;
font-size: 1px;
line-height: 0px;
}

Because I intend on linking an image to this page I want to make sure that the image will not have a border when I mouse over it. So in this demo I will first add an image that is linkable to the index.php page. The code looks like this.

<a href=”http://www.google.ca/”><img src=”http://www.google.ca/intl/en_ca/images/logo.gif” alt=”” name=”image” width=”276″ height=”110″ id=”image” /></a>

Place the code into the main content div of your page and preview the page before changing the CSS so you know what the browser will want to do automatically. Now that you can see the large blue lines around the image you can place this code into the style.css page. As long as the code is not placed inside of another attribute it will work, it is a good idea to keep the separate styles close together based on where they come on the page so you may want header first then content followed by sidebar then footer.

#mainContent img{
float:left;
border: 0px;
text-decoration:none;
}

Because the CSS entered above has a hash sign followed by the content section and a space with “img” typed after; the following effects will only apply themselves to images inside of the main content. If you would like all of the images to display no border then you would have to enter the following code.

img {
border: 0px;
}

This is a very important technique when styling a page and it comes in handy quite often. If I wanted the paragraph to be indented 20 pixels and the header to only be indented 10 pixels I would use a very similar method.

#mainContent h1,h2,h3{
padding-left: 10px;

}

#mainContent p {
padding-left:20px;
}

In order to give the page some boarders we could use the simple code.

#container {
border: 1px solid #444444;
}

Now you should have a simple understanding as to how CSS files can effect your document and one of the great things about them is that you can easily style all of the pages on your website by just linking back to the style sheet. This way if you need to change the look of something all you need to do is update the style.css file.

How to Remove Avira Pop ups on Vista

Avira and AVG are two of the greatest and most popular free anti-virus programs on the web today. Both of these programs offer deluxe versions of their software that will give you more protection and some perks but the advertisements can be really annoying.

I only mention AVG in this article because it is something of an alternative to Avira and is slowly being replaced, however, Avira has pop ups that are very annoying and are very close to spam. It isn’t something that comes up when you least expect it but something that will pop up while you are watching the season premier of House. Not cool…

avira_file_directoryThere is a way to remove these pop ups on Microsoft Windows Vista. In order to stop these ads from coming up you will need to follow the following instructions. First open ‘Start’ > ‘Computer’ > OS C: (or whatever drive your operating system is on.) > ‘Program Files’ > ‘Avira’ > ‘Avira Desktop.’ Now you will need to locate the file called. “avnotify.exe.” Right click this file and go down to properties. A window will appear, you will need to click on the security tab then click edit halfway down the window. Now you will need to adjust the read & execute and set it to deny. If the read does not automatically fill in you will need to deny that as well.

avira_permissions

Now just close the file and go back to coding without ever having the Avira adverts annoy you again.

The Switch from Go Daddy to Dreamhost

Slowly making a switch from the old blog over at theemptyheaded.com to a new one that will be replacing the content. The reason I am changing from one blog to the next is first and foremost, The Empty Headed blog is hosted by Go Daddy and I have not been happy with the services that they have been providing.

Not only was it next to impossible to cancel domain renewal for an old site of mine but they kept sending me emails saying that they had tried to charge the previous credit card for renewal of the said domain. It is very unprofessional on their behalf to send emails that ask you if you would like to renew your domain even after saying no.

browser

Aside from my renewal issues with Go Daddy I have been having frequent database connection issues where the code is not at fault. These errors stop users from properly visiting the blog and everything else on the site since everything is PHP and SQL.

Another reason for switching is, I already have a much better package deal with Dreamhost that includes unlimited bandwidth, storage, databases and hosted URLs. Much like go daddy they have the one click install for server installations which is very handy when new packages come out.

The final reason I am switching fully from go Daddy to Dreamhost is to increase my traffic with a new URL. When it comes to a web development a URL such as theemptyheaded.com is not going to bring me traffic from search engines that I am after, whereas codewithdesign.com will.

178 Web Icons

Ran across this great post that has downloadable icons for website. There is not price on these icons which is great considering the quality. You can click here to download them and click here to visit their blog.

Tags: , ,

The Beginners Guide to PHP

The beginners guide to PHP

The first thing that you are going to need to know about PHP is that it is built around HTML. Any PHP page can function the same as an HTML page. So if we were to go and put a head, body and some content in paragraphs you would have a successful HTML page being outputted by PHP.

1
2
3
4
5
6
7
8
<head>
<title>My PHP Page</title>
</head>
 
<body>
<h1>The Main Test Page</h1>
<p>This is the paragraph</p>
</body>

When you run the following lines inside of a PHP script you are essentially just coding in HTML but as a .PHP file.

Anything that you code in PHP must be between the PHP tags. If it is not between the PHP tags the browser will assume that it is HTML and will print out simple text from the browser.

1
2
3
4
5
<?php
 
?>
 
<? ?>

As you can see there are two different ways to show that the code is PHP. It is more formal among coders to use the first method of opening and closing tags but it is not necessary. It is more or less a way to recognize that the following code is PHP based.

It is always a good idea to properly comment the code that you are working on. This will help people that read your code if you ever need help with it. Also when going back to a project after quite some time you may be forgetful as tow hat variables and sections of the code are doing what. Which leads me to want to talk about assigning variables.

Unlike other programming languages where declaring a variable as an Integer, Boolean, Float, Etc is important and needed to get the program to run.  In PHP you can convert variables to these values but if you wanted to assign a variable with a number or text it only requires an equal sign.

1
2
3
<?php
//this is a comment
?>

Declaring a variable.

1
2
3
4
5
6
7
<?php
// declaring a variable
$pizza = “$13.99;
// printing the variable
echo $pizza;
 
?>

Notice how the variable has a $ sign on it. All variables must have this dollar sign in front of it in order to be noticed by the server processing the PHP. A variable can contain almost any information that you want and can be called anything, but it is a good idea to name them something that will help you remember them. If you have variables of $q, $h, $ht, $gh and so on. Chances are that you will be ridiculed by someone eventually. You are also going to have issues remembering the code that you have entered.

Functions are a very important part of PHP much like they are for any language. In this next example we are going to create our own function and apply it to some code with a variable and content outputs into a browser.

1
2
3
4
5
6
<?php
function roll() {
return mt_rand(1,6);
}
echo roll()
?>

As you can see, we have created a rolling dice with PHP. Within this function we included the “mt_rand”, similar to rand but has a more random output then the simple “rand.”
Now we are going to load a variable from the roll function that we have created then output it into the browser.

1
2
3
4
5
6
7
8
<?php
function roll() {
return mt_rand(1,6);
}
$roll1 = roll()
echo “you  have rolled a ” . $roll1 ., way to go!”
 
?>

With this short section of code you first create the function roll. After the function you then load it into the variable roll1. Now you have an output of this roll going to your browser. This output will say for example “ you have rolled a 1, Way to go!”