Results 1 to 6 of 6

Thread: page keeps using default CSS style, want to change it

  1. #1
    Join Date
    Mar 2007

    page keeps using default CSS style, want to change it

    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 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.

  2. #2
    Join Date
    Nov 2006
    If you would like to define a style for just the current page using Dreamweaver, go to the CSS panel and click the + sign.
    name the class or enter "body,p,td" of your new style then select "This document only".
    The new style will be only applied to the above tags in the current document only.
    Of course the new style definition has to be inserted after the external css link so that it can override the style for those tags.

  3. #3
    Join Date
    Nov 2003
    Jerryville, Tejas
    Is there a hierarchy that stylesheets follow?
    That's the C in CSS. There are three levels of cascade (external, embedded, inline). You can follow your link to your external style sheet with an embedded style sheet that will override any matching selectors in the external sheet. Inline styles entered via the style attribute at the element level override everything else.
    "Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." Brian W. Kernighan

  4. #4
    Join Date
    Mar 2007
    Ray326 and holyhttp

    Thank you both for replying. i think i follow what you said, but don't understand the terms you use, as i said i'm totally html and even dreamweaver illiterate. I can only just about do the basics.

    So basically you're saying, if i apply an inline style it should override everything else? How exactly can i do this?

    The only part i want to apply it to is this

    <%= CONTENT %>
    At the moment the above code insists on using the default, which is in the stylesheet, not what i put in the quotes with it in my first message.

    What exactly do i need i need to put and how, if i want to show the below attributes (in bold) and to override any other style applied via the stylesheet etc.

    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 12px;
    line-height: 15px;

    I am not even sure is the line height will be OK or even the right thing to use, what i want to do is increase the spacing between lines. At the moment it is too cramped for the "content" bit, though ok for the rest of the website. As 15px for the line height, i'm only guessing it will be OK, but if it works i can always change the figure to something approriate i suppose.

    Thanks for the tips and sorry for being so ignorant.

  5. #5
    Join Date
    Dec 2005
    American, living in Toronto, ON. CANADA
    Some Selectors won'; work on "<span>" (like "margin-top;" and margin-bottom;", etc) as this would 'break' the parent element if it did. "font-size;" would over-ride the parent "<p>" however. I am eyeing the default fomnt-size of "<p>"... 10px?? That is half the height of a scrollbar... I recall somewhere reading about IE having display trouble with font-sizes 'below 10px;'... Try 0.8em for the <p> font-size, and 0.8em for the span's font-size (or whatever).
    I had played a bit with this yesterday when I read this post, but wasn't getting the all the expected results. I suspect that at around 10 or 11px font-size, the difference is too imprecise to calculate and IE just throws an approximation. Generally, around 12px is a good 'easy-to-read' font-size and anything below that, requires ...help(?). "em"-size might be a bit more accurate if you're after 'the fine print'.

    I'll try to work this later..
    I build for: Firefox and tweak for IE

  6. #6
    Join Date
    Nov 2003
    Jerryville, Tejas
    As a first shot change the span to a div.
    "Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." Brian W. Kernighan

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center



X vBulletin 4.2.2 Debug Information

  • Page Generation 0.23108 seconds
  • Memory Usage 2,892KB
  • Queries Executed 13 (?)
More Information
Template Usage (34):
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_global_above_footer
  • (1)ad_global_below_navbar
  • (1)ad_global_header1
  • (1)ad_global_header2
  • (1)ad_navbar_below
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)ad_thread_first_post_content
  • (1)ad_thread_last_post_content
  • (3)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)headinclude_bottom
  • (6)memberaction_dropdown
  • (1)navbar
  • (4)navbar_link
  • (1)navbar_moderation
  • (1)navbar_noticebit
  • (1)navbar_tabs
  • (2)option
  • (6)postbit
  • (6)postbit_onlinestatus
  • (6)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available (6):
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files (26):
  • ./showthread.php
  • ./global.php
  • ./includes/class_bootstrap.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/functions_navigation.php
  • ./includes/class_friendly_url.php
  • ./includes/class_hook.php
  • ./includes/class_bootstrap_framework.php
  • ./vb/vb.php
  • ./vb/phrase.php
  • ./includes/functions_facebook.php
  • ./includes/functions_calendar.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_notice.php
  • ./packages/vbattach/attach.php
  • ./vb/types.php
  • ./vb/cache.php
  • ./vb/cache/db.php
  • ./vb/cache/observer/db.php
  • ./vb/cache/observer.php 

Hooks Called (70):
  • init_startup
  • friendlyurl_resolve_class
  • init_startup_session_setup_start
  • database_pre_fetch_array
  • database_post_fetch_array
  • init_startup_session_setup_complete
  • global_bootstrap_init_start
  • global_bootstrap_init_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • load_show_variables
  • load_forum_show_variables
  • global_state_check
  • global_bootstrap_complete
  • global_start
  • style_fetch
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • strip_bbcode
  • friendlyurl_clean_fragment
  • friendlyurl_geturl
  • forumjump
  • cache_templates
  • cache_templates_process
  • template_register_var
  • template_render_output
  • fetch_template_start
  • fetch_template_complete
  • parse_templates
  • fetch_musername
  • notices_check_start
  • notices_noticebit
  • process_templates_complete
  • friendlyurl_redirect_canonical
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • memberaction_dropdown
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • build_navigation_data
  • build_navigation_array
  • check_navigation_permission
  • process_navigation_links_start
  • process_navigation_links_complete
  • set_navigation_menu_element
  • build_navigation_menudata
  • build_navigation_listdata
  • build_navigation_list
  • set_navigation_tab_main
  • set_navigation_tab_fallback
  • navigation_tab_complete
  • fb_like_button
  • showthread_complete
  • page_templates