473,893 Members | 1,861 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

web page keeps using default CSS style sheet setting

114 New Member
I have an ASP web page which has a style sheet attached. It is a news page which is added from a separate admin section. The news adding section does have a rich text editor to change text or format it.. My problem is this.

The CSS stylesheet is set up to show the body text as below.

Expand|Select|Wrap|Line Numbers
  1.       body,p,td{font-family:Verdana, Arial, Helvetica, sans-serif;font-size:10px;color: Black}
this is fine on most pages, however in the page which has the body of the article i want it to show a font size 12, with wider line spacing. If i alter the CSS code above, it alters the body on other pages which i don't want changed. In short i'm happy with a size 10 font i only want one section of the web changed, but i'm finding it very hard to do that. I use dreamweaver, but don't know how to use it properly.

I tried altering the code of section i want changed but it still keeps showing the one on the stylesheet. It does however show the line spacing. How do i get it to alter the size to size 12? It completely ignores the below, except the line- height.

Expand|Select|Wrap|Line Numbers
  1.  <span style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; line-height: 15px;"><%= CONTENT %></span>  
Is there a hierarchy that stylesheets follow?
What i want is for this particular section (lets call it style 3) to have a size 12 font, with wider line spacing than the default for this section. One and a half size line spacing would be OK.
I'm totally html illiterate, so any help appreciated. Thanks in advance.
May 11 '07 #1
12 2607
drhowarddrfine
7,435 Recognized Expert Expert
Yes, CSS follows a cascade (Cascading Style Sheet) and a hierarchy.

What you can do is this. Say the text is inside a <p>. You can give that tag a unique name called an 'id'. Let's call it "style3". So:
<p id="style3">

Now, in your css, you can say:
Expand|Select|Wrap|Line Numbers
  1. #style3{
  2. font-size:12px;
  3. line-height:15px;
  4. }
  5.  
And that will be applied only to that tag.

Keep in mind that an id can be used just once per page. If you need to reuse that style on other elements, call it a 'class' instead.
Expand|Select|Wrap|Line Numbers
  1. <p class="style3">
  2.  
  3. .style3{
  4. font-size:12px;
  5. line-height:15px;
  6. }
  7.  
Notice the 'dot' in front of the "style3" above.
May 11 '07 #2
karen987
114 New Member
Yes, CSS follows a cascade (Cascading Style Sheet) and a hierarchy.

What you can do is this. Say the text is inside a <p>. You can give that tag a unique name called an 'id'. Let's call it "style3". So:
<p id="style3">

Now, in your css, you can say:
Expand|Select|Wrap|Line Numbers
  1. #style3{
  2. font-size:12px;
  3. line-height:15px;
  4. }
  5.  
And that will be applied only to that tag.

Keep in mind that an id can be used just once per page. If you need to reuse that style on other elements, call it a 'class' instead.
Expand|Select|Wrap|Line Numbers
  1. <p class="style3">
  2.  
  3. .style3{
  4. font-size:12px;
  5. line-height:15px;
  6. }
  7.  
Notice the 'dot' in front of the "style3" above.
Thank you for your help drhowarddrfine,

Actually i only want to apply it to
<%= CONTENT %>

so does that mean i should change the code in my webpage to to

<p id="style3"><% = CONTENT %>

Sorry for my ignorance, but i only know the very basics of dreamweaver and html, and don't know about coding. Thanks for your help.
May 12 '07 #3
karen987
114 New Member
I tried this, and it didn't work,
Expand|Select|Wrap|Line Numbers
  1. <p class="style3"><%= CONTENT %></p>  
and in the CSS external style sheet i added

Expand|Select|Wrap|Line Numbers
  1. .style3{
  2. font-size:12px;
  3. line-height:15px;
  4. }
May 12 '07 #4
drhowarddrfine
7,435 Recognized Expert Expert
You are losing me there since I know little about asp. You might ask over on the asp board. I'm guessing that the <% part inserts the content plus any other html associated with that. If so, the CSS and the html I gave may not function correctly; it depends on what gets inserted by that <% stuff.
May 12 '07 #5
karen987
114 New Member
You are losing me there since I know little about asp. You might ask over on the asp board. I'm guessing that the <% part inserts the content plus any other html associated with that. If so, the CSS and the html I gave may not function correctly; it depends on what gets inserted by that <% stuff.
Hi Dr Howard,

If i change the first function i mentioned above, then it does work. How can i insert what the others advised me above in an INLINE style?

thanks
May 12 '07 #6
drhowarddrfine
7,435 Recognized Expert Expert
I'm shooting in the dark without seeing code. The typical way in CSS is:
display:inline;
May 12 '07 #7
yinxing
1 New Member
<head>
......
<style type="text/css">
... ...
.stylename{
font-size:12px;
line-height:18px;
}
... ...
</style>
... ...
</head>
<body>
... ...
<p class="stylenam e"><% =your word %></p>
... ...
</body>
May 12 '07 #8
karen987
114 New Member
<head>
......
<style type="text/css">
... ...
.stylename{
font-size:12px;
line-height:18px;
}
... ...
</style>
... ...
</head>
<body>
... ...
<p class="stylenam e"><% =your word %></p>
... ...
</body>
someone told me that the P class wont work in a table?
May 13 '07 #9
karen987
114 New Member
OK for the one who said he's shooting in the dark, here is some code from the page, it's the "content" at the end i want styling. It is in a table, so maybe that's why the P class doesn't work?

Expand|Select|Wrap|Line Numbers
  1. <td width="570" valign="top">
  2.                     <!-- Main Article -->
  3.                         <img src="pixel.gif" width="400" height="1" alt="" border="0" />
  4.                         <table cellpadding="0" cellspacing="0" border="0" width="100%"><tr>
  5.                             <td class="ArticleTitle"><%= TITLE %></td>
  6.                             <td>
  7.                                 <table cellpadding="2" cellspacing="5" border="0" align="right"><tr>
  8.                                     <td align="center"><a href="email_article.asp?ID=<%=NID%>" class="HelpLink" onClick="NewWindow(this.href,'name','575','220','Yes');return false;"><img src="images1/img_sendto.gif" width="14" height="9" alt="Email This Article ..." border="0"></a></td>
  9.                                     <td align="center"><a href="view_printer.asp?ID=<%=NID%>"><img src="images1/img_print.gif" width="14" height="14" alt="Printer Friendly ..." border="0"></a></td>                              
  10.                                     <td><a href="export.asp?m=doc&amp;id=<%=NID%>"><img src="word_document.gif" width="16" height="16" alt="Export to MS Word Document ..." border="0" /></a></td>
  11.                                     <td><a href="export.asp?m=txt&amp;id=<%=NID%>"><img src="images1/txt_doc.gif" width="15" height="16" alt="Export to plain text document ..." border="0"></a></td>
  12.                                 </tr></table>                            </td>
  13.                         </tr></table>
  14.                         Filed under  <em><%=CATEGORIES%></em> on <%= FormatDateTime(POSTED,DATE_F) %><%IF SHOW_AUTHOR = True THEN%> By: <%=AUTHOR%><%END IF%>.
  15.                         <hr size="1" style="color: WhiteSmoke;height: 1px;width: 100%;" />
  16.          <%= CONTENT %>
  17.                         </span>                                               <br />    
and this is the CSS default body code. I want it to remain the same, except for the font size which should be 12 . Is it possible to have 2 body styles?


Expand|Select|Wrap|Line Numbers
  1.      body,p,td{
  2.     font-family:Verdana, Arial, Helvetica, sans-serif;
  3.     font-size:10px;
  4.     color: Black;
  5.     line-height: 120%;
  6. }
May 13 '07 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

11
6620
by: Grasshopper | last post by:
Hi, I am automating Access reports to PDF using PDF Writer 6.0. I've created a DTS package to run the reports and schedule a job to run this DTS package. If I PC Anywhere into the server on where the job is running, the job runs sucessfully, PDF files got generated, everything is good. If I scheduled the job to run at the time that I am not logged into the server, Access is not able to print to the printer. The error is pretty...
8
2156
by: Alan J. Flavell | last post by:
What I was trying to do: to offer a default stylesheet, plus another small stylesheet which can be applied additionally to the default one. Preferably, the optional stylesheet should be initially in effect, but the user should be able to turn it off. My reading of the HTML4 spec (which is where this seems to be documented, though I reckon it's on-topic for this group): it seems to me that what I want, in the terms described there, is...
6
4912
by: scottyman | last post by:
I can't make this script work properly. I've gone as far as I can with it and the rest is out of my ability. I can do some html editing but I'm lost in the Java world. The script at the bottom of the html page controls the form fields that are required. It doesn't function like it's supposed to and I can leave all the fields blank and it still submits the form. Also I can't get it to transfer the file in the upload section. The file name...
7
1538
by: Will Hartung | last post by:
I have a simple rule: ..main p { font-size: small; color: red;} But if I put a paragraph in a TABLE, it basically comes out black and a different size. I found if I did: ..main table { font-size: small; color: red;}
7
2413
by: GaryDean | last post by:
In my old 1.1 apps the default was MS_POSITIONING="GridLayout" and Textboxes and labels and such always had POSITION: absolute; and I never had any distortion when the page was rendered. Life was good. now in 2.0 I'm using the default placeholder and putting a table in the placeholder and putting controls in the cells in the table. "the way it is supposed to be done" I have a textbox in a table that is defined as follows... <td...
8
6705
by: JT | last post by:
Hi, I have done a fair amount of style editing inline in ASP. I'm now using VS 2005 with a standard web project (not Web Application Project). This is my first foray into CSS in a style sheet and also my first true attempt at using master pages. I tried setting up a style sheet with a simple setting to float an image to the right and it had no effect on the image. Then, I tried putting the style code in my ASPX file as such,
9
2005
by: =?Utf-8?B?Sm9obiBCYWlsZXk=?= | last post by:
I have a ASP .Net page that allows moving around items on the page through javascript. This page works fine in IE. In FireFox however, I have found that if the page is using XHTML 1.0 Transitional as the doctype, you cannot set the style.left and style.top properties of image or div tags. If you remove the doctype from the page it works just fine, although I would rather not do this. You can work around this by setting the cssText...
19
3445
by: Steve | last post by:
Hi there, I'm having a problem with a webpage where hoving over the top navigation links causes my footer to jump up to the centre of the page! It only happens with IE7, and works fine with the latest versions of Firefox and Safari (both PC and Mac), and even fine on IE6. My main page has three columns in it, from left to right, 1, 2, 3. The foot is jumping up to the bottom of column 3 it seems upon hovering over the navigation...
5
5453
by: Andreas Prilop | last post by:
Firefox 3 (like older versions) ignores TR { page-break-before: always } for the first row of a TBODY. Sample page: http://www.unics.uni-hannover.de/nhtcapri/temp/1000.html Choose "Print Preview". Internet Explorer 6/7 prints every row onto a new page;
0
9832
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10840
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10929
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10469
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9647
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6066
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4684
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4281
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3293
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.