Results 1 to 9 of 9

Thread: Modifying text styles for

  1. #1
    Join Date
    Jun 2011
    Posts
    6
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Modifying text styles for

    1) Script Title: simpleGallery

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...suppliment.htm

    3) Describe problem: Trying to make my image descriptions (alternating below the image gallery, as described in "Creating Custom Controls by Calling navigate()" on DD. Working perfectly, but I need to have some text in italics in the description panel, which is called by the var vacationtext. How do I modify the text so that it calls different css elements? I've tried implementing simple italics (em /em) html tags within the text itself, but doesn't work...

  2. #2
    Join Date
    Jun 2011
    Posts
    6
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Modifying Text Styles for Simple Gallery Description


  3. #3
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    In the resource/HTML/grey/css/style.css file, line 10:

    Code:
    address, caption, cite, code, dfn, em, strong, th, var 		{ font-style:normal;font-weight:normal; }
    This sets the em tag to normal, not italic. If you remove em from that definition, you may then use the em tag to show italics.

    Alternatively you could leave it in there and make a separate rule:

    Code:
    #myvacation em {font-style: italic;}
    Since it keys off of the container id it might be able to go anywhere. But after line 10 would probably be wise.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  4. The Following User Says Thank You to jscheuer1 For This Useful Post:

    sneakyburt (06-22-2011)

  5. #4
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,643
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

    Default

    Quote Originally Posted by sneakyburt View Post
    ... I've tried implementing simple italics (em /em) html tags within the text itself, but doesn't work...
    <em> is not an "italics" tag. you might consider simply using the <i> element.

    a really good explanation.

    So, why does your text need to be italicized? If it's simply typographical (no stress emphasis: if you were speaking, your voice wouldn't crack), then using <i> is perfectly appropriate.

    ( <em>if</em> you're using <i>HTML5</i>. )
    Last edited by traq; 06-02-2011 at 04:08 AM.

  6. #5
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Quote Originally Posted by traq View Post
    So, why does your text need to be italicized?
    If you look at the page, it's taxonomic nomenclature (say that ten times fast). The i tag might work given the current style of the page. But there are some odd resets. Best thing to do would be to create a selector as indicated in my previous post. Perhaps a class would be good for that, instead of the child selector I posted. But in any case it should be something that could be changed in one place to affect all instances.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  7. #6
    Join Date
    Jun 2011
    Posts
    6
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    Thanks! That sure did it. And you also answered traq's question perfectly. Two for two! To note the Latin/Scientific name of an organism properly, the two part name of the species must be italicized. Thanks again.

  8. #7
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    traq's point is still valid though. He was just asking if semantically you need to emphasize the scientific name, or if merely italicizing its presentation is sufficient. I think one could go either way on that one. I favor emphasis, as that's how it's most often spoken, at least to my recollection.

    This really only comes into play for screen readers and other software for special user needs/preferences where italics are either not shown or are irrelevant in some way.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  9. The Following User Says Thank You to jscheuer1 For This Useful Post:

    sneakyburt (06-22-2011)

  10. #8
    Join Date
    Jun 2011
    Posts
    6
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    Ahh. I understand. Well I have a second question regarding this feature - - the #myvacation{ css element only effects the heading of each image in the gallery... I'd like to change the size of the text description of each image, but can't find what determines this size?

  11. #9
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Elements' styles which are not implicitly inherited and that are defined elsewhere will take precedence unless specifically redefined for when they appear in the myvacation division. Here's what's in a typical description:

    HTML Code:
    <div id="myvacation">
    <strong>Spider Tool</strong>
    <p>Western lynx spider; <em>Oxyopes scalaris</em> (Oxyopidae); male adult shown here; male body length, when mature, ranges from 4.7-6.1 mm; many leg spines are perpendicular to the leg.</p>
    </div>
    From what you're saying and from looking at the page again, the p font size is defined elsewhere as 12px, while the strong font size is not so inherits the 14px for myvacation. The em font-size isn't defined elsewhere so inherits the p's font size because it's located inside the p.

    You can make a selector and rule set like:

    Code:
    #myvacation, #myvacation * {
    	font: verdana, arial, helvetica, sans-serif;
    	text-align: left;
    	line-height: 17px;
    	font-size: 20px;
    	color: #000;
    }
    That will take them all in. Or you can select separately (like if you want different colors, font-sizes, etc. for each):

    Code:
    #myvacation strong {
    Code:
    #myvacation p {
    Code:
    #myvacation em {
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  12. The Following User Says Thank You to jscheuer1 For This Useful Post:

    sneakyburt (06-22-2011)

Bookmarks

Posting Permissions

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