CSS and syle sheets for paragraphing.

R

Richard Webster

I can't seem to get a style sheet to work in FP 2003.

I create a webpage and a style sheet and format a link to it and add some
styles. I save the stlye sheet and the web page and preview in browser and
it works. I add some more styles nad gone on - fine - and then suddenly a
style that I've added doesn't work when previewed in IE7 for some reason.

For example I have:

p {
color: #000080;
}
p.hdg { font-size: 182%; font-weight: bold; font-style: italic;
margin-bottom: -8; margin-top: -5; color: #000080 }
p.hdg3 {font-weight: bold; font-style: italic; font-size: 103%; color:
#000080;}
p.foot {font-size: 70%; font-style: normal; color:#666666; margin-bottom:
-0.1; margin-top: -0.1;}
p.sidebar {color: #FFFFFF; text-align: center; font-style: normal;
margin-top: -7; }
p.purple {color: #800080;}


p.hdg, p.foot & p.purple dpn't seem to work when previewed in IE7 but they
dfo appear in design view in FP 2003. What am I doing wrong?
 
M

Murray

p.hdg { font-size: 182%; font-weight: bold; font-style: italic;
margin-bottom: -8; margin-top: -5; color: #000080 }

Length values must always have a unit, e.g.,

margin-bottom:-8px; margin-top:-5px;

As for the other questions, we would need to see your code.
 
R

Richard Webster

Thanks for that, Murray,

Ive tried again with yet another style sheet and this time I've added the
entries using FP2003's Add Style Box. It seems to add these just as .hdg,
..purple, etc and at the moment they work. What is frustrating is that I
seem to get the styles on the sheet to work when the pages are vieewed in IE7
and Mozilla but aftere a few days when I go in again with a new page with
very similar coding suddenly none of them work, so I wonder whetehr it is
something I've done to sthe style sheeet.

Does the location of the various elements on the style sheet make any
difference?


Coding example for p.hdg (now.hdg):

<td width=78% id="hdgcell" align="center"><p class="hdg">Hampshire
Conveyancing Solicitors</p></td>


In the style sheet I have :

#hdgcell {text-align: center; margin: -5 25; padding-top: 0.25cm;
padding-bottom: 0.25cm;}

And for p.foot (or .foot) I have

<td id="footer" width=78%>
<p class="foot">Copyright: Richard Webster & Co 2007</p>
<p class="foot">Richard Webster & Co 30 Leigh Road Eastleigh Hampshire
SO50 9DT</p>
<p class="foot">Hampshire Solicitors for Conveyancing in the Southampton
area, South Hampshire, and Wiltshire.</p>
<p class="foot">Page Last Revised
<!--webbot
bot="Timestamp" S-Type="EDITED" S-Format="%d/%m/%y" --></p>
</td>

and there is a defintion in the style sheet:

#footer {padding: 0.2cm 0.5cm; color: #666666;}

What is really frustrating is that it works for a time and then suddenly
doesn't work - I start from scratch with a new style sheet which I link to
the existing pages and add styles to it testing to see if they work before
adding more and I get there - then afew days later when I am adding a
furthere page (based on the same intial template) suddenly it doesn't work.
I appreciate that you prbably can't speculate what this could be iwthout
seeing masses and masses of code but are there any known gltiches in FP 2003
that could cause this?
 
M

Murray

so I wonder whetehr it is
something I've done to sthe style sheeet.

I doubt it. The problem could be diagnosed if you had some *before* and
*after* code to look at.
Does the location of the various elements on the style sheet make any
difference?

It certainly could.
<td width=78% id="hdgcell" align="center"><p class="hdg">Hampshire
Conveyancing Solicitors</p></td>


In the style sheet I have :

#hdgcell {text-align: center; margin: -5 25; padding-top: 0.25cm;
padding-bottom: 0.25cm;}

In this example, you have a container with an ID rule that applies to it and
its contents, and a contained element with a class rule that applies to it
and its contents. If the ID rule and the class rule conflict, the ID rule
will override the class rule, since an ID selector has a greater specificity
(it can only be used on a single page element) than a class rule (it can be
used on multiple page elements).
What is really frustrating is that it works for a time and then suddenly
doesn't work

Perhaps it seems this way, but it's just impossible. I suspect what's
happening is that your understanding of CSS inheritance and specificity is
not covering small changes you may have made to the code that would affect
both of those characteristics.
are there any known gltiches in FP 2003
that could cause this?

No.
 

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