CSS with frontpage

M

Mark

I am relatively new to CSS. I understand how you can set up the same font
size and colors for headings and text but is there a way if for example you
are using an 800 pixel wide table that is centered with a certain colored
background that you are using for your web site creation. Meaning the web
site pages will be centered and the site will be 800 pixels wide.

Thanks
 
M

Murray

Perfect. You'd think someone who would write something like this would come
up with a site that was not as stark as this one, though....
 
D

David Berry

I thought the same thing. Very blah.


Murray said:
Perfect. You'd think someone who would write something like this would
come up with a site that was not as stark as this one, though....
 
M

Mark

Thanks for the information.. But I'm just wondering when you create a css
style page how you incorporate that code on the link you provided into
frontpage?
 
M

Mark

So what you are saying is to copy the code from the web page and paste it
in. Then save that page as a .css document. Is that correct?
 
M

Murray

Yes, but make sure that you DO NOT COPY any of the HTML, e.g., if the web
page has this -

<style type="text/css">
<!--
body { color:black; }
-->
</style>

you would copy and paste this -

body { color:black; }
 
D

David Berry

No. Save it as a regular .htm page. The CSS is contained in the page.
You would only save it as .css if you were making an external stylesheet and
linking that to the page.

PS - you should copy it into Notepad first and then copy from Notepad to
Code View in FrontPage otherwise you're going to get all kinds of HTML
formatting from the web site with it.
 
D

David Berry

He would do that only if he wanted to make an external stylesheet (ex:
mystyle.css) otheriwse the code from that site can be copied right into the
HTML (and the page saved as .htm) as an embedded stylesheet


Mark, if you want to do it the way Murray suggests then you'll need to add:

<link rel="stylesheet" type="text/css" href="mystyle.css">

between the <head></head> tags where mystyle.css is what you called the page
you saved the CSS to. In that case instead of the way they have it on the
sample:

<html>
<head>
<style>
body{
text-align:center;
}
#container{
margin:0 auto;
width:500px;
text-align:left;
}
</style>
</head>
<body>
<div id="container">
...
</div>
</body>
</html>

You would have 2 page. The .css page (ex: mystyle.css) and your HTML page.
The .css page would have JUST:

body{
text-align:center;
}
#container{
margin:0 auto;
width:500px;
text-align:left;
}

and your HTML page would have:

<html>
<head>
<link rel="stylesheet" type="text/css" href="mystyle.css">
</head>
<body>
<div id="container">
...
</div>
</body>
</html>

The advantage to an external stylesheet is that you can just add it to every
page without having all the CSS code in each page and then you only have one
spot where you need to make a change and it will change on all pages.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top