Forum Moderators: not2easy

Message Too Old, No Replies

<p> tag in css not showing in browser

         

sjaver

2:31 pm on Jun 26, 2010 (gmt 0)

10+ Year Member



Hi,

I have a piece of code that I noticed is not working in IE - I use dreamweaver and have given my <p> tag the following attributes:
p {
text-indent: 15px;
margin-top:25px;
}
I can actually see it working in DW - but it doesn't translate when I view the page locally or on the web. The only way I can get the same effect is to put "&nbsp;&nbsp;" in front of the paragraph. Why wouldn't my css be working correctly?

Any thoughts would be helpful.

Major_Payne

6:15 pm on Jun 26, 2010 (gmt 0)



Can you post the code for the HTML, too? The CSS is correct and worked locally for me. Just be sure NOT to have any empty paragraph tags. If you need to use one as a spacer, be sure to insert a non-breaking space character.

Make sure that the CSS file is being properly linked to with the link tag. Files that are in other folders will have different path to CSS file than a file that has the CSS file in same folder.

sjaver

12:09 am on Jun 27, 2010 (gmt 0)

10+ Year Member



Thanks for getting back to me!

<p align="left">Now the house is very interesting.&nbsp; It lays out long and multi-level.&nbsp; The kitchen will be just as dramatic in whites with a glass table and curved bench with angular chairs.&nbsp; Metallic ultrasuede and white vinyls, so striking.</p>

The actual site is: [thecontemporarycouch.com...]

I am so puzzled.

Major_Payne

1:27 am on Jun 27, 2010 (gmt 0)



You can't indent if your inline CSS has this: align="left"
I removed it and it didn't matter so there's something else causing it not to indent.

Why are HTML tags on the CSS?:
Code for aligning 3 images on a page:

<p style="float: left; width: 32%; text-align: left;">Left text</p>

<p style="float: left; width: 32%; text-align: center;">Centre text</p>

<p style="float: left; width: 32%; text-align: right;">Right text</p>


Wouldn't hurt to correct these errors:

24 CSS errors [jigsaw.w3.org]

102 Critical HTML errors [validator.w3.org]

Most of those errors have been flagged because you are using a XHTML 1.0 document type and not coding to it.

Major_Payne

1:52 am on Jun 27, 2010 (gmt 0)



OK. Think I found the problem. This is missing the closing "}":

.mischeadingandborder{font-size:24pt;
font-style:italic;
font-weight:bold;
table-layout:fixed;
width:50%;
height:auto;
border:solid;
border-color:#ec171d;
border-style:double;
margin-left:auto;
margin-right:auto;
position:relative;
color:#F79646;


Should be:
.mischeadingandborder{
font-size:24pt;
font-style:italic;
font-weight:bold;
table-layout:fixed;
width:50%;
height:auto;
border:solid;
border-color:#ec171d;
border-style:double;
margin-left:auto;
margin-right:auto;
position:relative;
color:#F79646;
}

sjaver

1:06 pm on Jun 27, 2010 (gmt 0)

10+ Year Member



Thank you so much - it was the } causing the problem. Now I have a host of other things to be concerned about - the errors you pointed out. DW automatically codes XHTML 1.0 document type and I just went from there - I don't have a great handle on document typing - I will go through the errors and try to correct. I have been doing this for a while and tend to fly by the seat of my pants!

As far as the aligning images code - I found the snippet and it worked - so I put it on the css page, so I wouldn't forget how to do it - it is just hanging out there temporarily.

You are the best!
Sharon

Major_Payne

6:54 pm on Jun 27, 2010 (gmt 0)



Never put HTML code on a CSS page unless you comment it out. Dreamweaver has a validator tool. Try it and see how it works for you. Not sure if DW has an HTML Tidy tool or not. This will correct some errors, but you have to be careful using it as it is NOT human. :P Some of the corrections may change the look of your page.