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. - 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. - <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.
12 2607
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: -
#style3{
-
font-size:12px;
-
line-height:15px;
-
}
-
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. -
<p class="style3">
-
-
.style3{
-
font-size:12px;
-
line-height:15px;
-
}
-
Notice the 'dot' in front of the "style3" above.
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: -
#style3{
-
font-size:12px;
-
line-height:15px;
-
}
-
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. -
<p class="style3">
-
-
.style3{
-
font-size:12px;
-
line-height:15px;
-
}
-
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.
I tried this, and it didn't work, - <p class="style3"><%= CONTENT %></p>
and in the CSS external style sheet i added - .style3{
-
font-size:12px;
-
line-height:15px;
-
}
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.
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
I'm shooting in the dark without seeing code. The typical way in CSS is:
display:inline;
<head>
......
<style type="text/css">
... ...
.stylename{
font-size:12px;
line-height:18px;
}
... ...
</style>
... ...
</head>
<body>
... ...
<p class="stylenam e"><% =your word %></p>
... ...
</body>
<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?
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? - <td width="570" valign="top">
-
<!-- Main Article -->
-
<img src="pixel.gif" width="400" height="1" alt="" border="0" />
-
<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr>
-
<td class="ArticleTitle"><%= TITLE %></td>
-
<td>
-
<table cellpadding="2" cellspacing="5" border="0" align="right"><tr>
-
<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>
-
<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>
-
<td><a href="export.asp?m=doc&id=<%=NID%>"><img src="word_document.gif" width="16" height="16" alt="Export to MS Word Document ..." border="0" /></a></td>
-
<td><a href="export.asp?m=txt&id=<%=NID%>"><img src="images1/txt_doc.gif" width="15" height="16" alt="Export to plain text document ..." border="0"></a></td>
-
</tr></table> </td>
-
</tr></table>
-
Filed under <em><%=CATEGORIES%></em> on <%= FormatDateTime(POSTED,DATE_F) %><%IF SHOW_AUTHOR = True THEN%> By: <%=AUTHOR%><%END IF%>.
-
<hr size="1" style="color: WhiteSmoke;height: 1px;width: 100%;" />
-
<%= CONTENT %>
-
</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? - body,p,td{
-
font-family:Verdana, Arial, Helvetica, sans-serif;
-
font-size:10px;
-
color: Black;
-
line-height: 120%;
-
}
Sign in to post your reply or Sign up for a free account.
Similar topics |
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...
|
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...
|
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...
|
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;}
|
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...
| |
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,
|
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...
|
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...
|
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;
|
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,...
|
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...
| |
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,...
|
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...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
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...
| |