You are viewing our Forum Archives. To view or take place in current topics click here.
Just started to learning HTML and CSS
Posted:

Just started to learning HTML and CSSPosted:

JustTaazR
  • Prospect
Status: Offline
Joined: Feb 01, 201113Year Member
Posts: 634
Reputation Power: 36
Status: Offline
Joined: Feb 01, 201113Year Member
Posts: 634
Reputation Power: 36
I have followed a tutorial that shows me the basics of both and i have managed to get a website up and running but it has a white background, how can i add a picture or something as the background?

Also how would i add a google search engine in so people can search straight from it.
#2. Posted:
Boolean
  • V5 Launch
Status: Offline
Joined: Jan 04, 201114Year Member
Posts: 1,732
Reputation Power: 72
Status: Offline
Joined: Jan 04, 201114Year Member
Posts: 1,732
Reputation Power: 72
Hello man congrats on getting into HTML and CSS! Mind if I ask where you are learning from?
To answer your question to add a background image or maybe you just want to add a regular image to the body of the webpage, you would use the <img /> tag for a regular image. Now this tag is called a "self closing" tag, this means the tag doesn't need to be closed again using the name, Ex. <img></img>.
So for an image on the webpage you would just write <img src="IMAGE LOCATION" />
"src" stands for source, so you are stating where the file is.

Now for the background image you are going to want to use CSS, not sure how far into CSS you are but I will explain just in case. We are going to do some internal styling using CSS so what that means is the elements we wish to style will be stated in the head of the webpage in the style tags. <style>Write Styling Here </style>
So to make the background an image, that is editing the body, so we need to state that in our <style></style> tags.
<style>
     body {background-image: url (IMAGE NAME or Location)}
</style>

So I put image name or location because depending on where your html file is depends on what you would write there. If your html file is in the same directory of the image you would only write the name of the image itself, if not then you have to write out the path for it's location.

Hopefully I helped a little bit, let me know if you have any questions.
Jump to:
You are viewing our Forum Archives. To view or take place in current topics click here.