Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Center image on HTML page and Background image in CSS

Status
Not open for further replies.

sharkchaser

Technical User
Mar 19, 2010
50
US
All nighter again . . .

How can I center these images on an HTML page?

SIMPLE method please.
Code:
<img src="/MacroValueChart.jpg" vspace="10" width="950" height="700" alt="macrovaluechart" longdesc="/MacroValueChart.jpg" />
  <img src="/MicroValueChart.jpg" vspace="10" width="950" height="700" alt="microvaluechart" longdesc="/MicroValueChart.jpg" />

My background image failed again - doesn't show and I can't figure out whats wrong.

Code:
<style type="text/css" media=all>


body  {
  width:100%;
  background-color: #ffffff;
  background-image: url(/"PrarieWind.jpg");
  background-position:center;
  
  }

p {text-align: justify; color: #000 ;font-size: 1.6em
	margin-left:auto;
	margin-right:auto%; 
	width:950px;

Thanks much.

Rick
 
This works fine for the background:
Code:
<html>
<head>
<style type="text/css">
body {
  width:100%;
  background-color: #ffffff;

background-image:url('[URL unfurl="true"]http://www.tek-tips.com/images/header-logo.gif');[/URL]
background-position:center;
background-repeat:no-repeat;}
</style>
</head>

<body>
<h1>Hello World!</h1>
</body>

</html>

You look like you have a misplaced slash:
Code:
  background-image: url([blue][b]/[/b][/blue]"PrarieWind.jpg");

Greg
People demand freedom of speech as a compensation for the freedom of thought which they seldom use. Kierkegaard
 
Thanks.

That has been fixed to no avail.

Question - in a CSS stylesheet what is the order of things?

You know . . .

<!DOCTYPE . . .
<html xmlns . . .
<link rel="stylesheet" type="text/css" href="main.css" />
<meta http-equiv="Content-Type" . . .
<style type="text/css" media=all>

body {
background-color: #ffffff;
background-image: url(/"PrarieWind.jpg");
background-position:center; text-align:center;
width:950px;

}

What's the </TAG> order for closing a CSS Stylesheet at the bottom of the page?

Thanks much. Rick
 
Please, please check some of the css and dreamweaver css tutorials I suggested in another post.

An embedded stylesheet starts with
Code:
<style type="text/css">

includes styles e.g.
Code:
body {
  width:100%;
  background-image:url('[URL unfurl="true"]http://www.tek-tips.com/images/header-logo.gif');[/URL]
   background-position:center;
   background-repeat:no-repeat;}
p {
color: #000 ;
font-size: 1.6em;
}
etc.
and closes with:
Code:
</style>

It should appear in the head section of your html.




Greg
People demand freedom of speech as a compensation for the freedom of thought which they seldom use. Kierkegaard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top