Results 1 to 10 of 10

Thread: Cursor is now gone..?

  1. #1
    Join Date
    Mar 2007
    Posts
    38
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Cursor is now gone..?

    Ok, Being new to css/web design I'm learning more and more about how to properly code but it seems as soon as I get one thing working then another stops.
    Here's my problem today. Thanks in advance.


    When I put in the code like this, the mouse over cursor works great but when I try to do what I think is the correct way then it stops working..

    <p><a class="specialLink" style="CURSOR: url('img/test.ani')" href="tools/test.pdf" target="_blank">How to: "Test Test"</a href></p>


    New way which (I think is correct)it stops working..

    <p><a class="specialLink"
    style="
    CURSOR: url('img/test.ani')
    font-family: 'Arial Black', Arial, sans-serif;
    font-size: 140%;
    "
    href="tools/test.pdf"
    target="_blank"
    >
    Test Test
    </a>
    </p>

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    linebreaks in html are usually ignored, but I think in the case above, it should be all on one line. That may be the whole issue.

    That, or it might be an issue with having both a class, which sets a style, and literal style tag, which also sets a style.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  3. #3
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    No, that's fine. style overrides the class, and linebreaks are ignored. However, there is no property named CURSOR (CSS is case-sensitive) and you need to always separate properties with a semicolon (;).
    Code:
    <p>
      <a
        class="specialLink" 
        style="
          cursor: url('img/test.ani');
          font-family: 'Arial Black', Arial, sans-serif;
          font-size: 140&#37;;
        "
        href="tools/test.pdf" 
        target="_blank"
      >
        Test Test
      </a>
    </p>
    With regard to this:
    Code:
    <p><a class="specialLink" style="CURSOR: url('img/test.ani')" href="tools/test.pdf" target="_blank">How to: "Test Test"</a href></p>
    <a href> is not a tag. href is an attribute of the <a> element.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  4. #4
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Alright. I'd still recommend removing the linebreaks to stay standard.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  5. #5
    Join Date
    Mar 2007
    Posts
    38
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Woohoo.. It worked great..


    I just added the ; and it worked.

  6. #6
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    I'd still recommend removing the linebreaks to stay standard.
    It's perfectly standard, and improves readability.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  7. #7
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Making a tag last several lines improves readability?

    Hmm... the better route is giving it a class and placing the CSS in the head, then, if it must be so long.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  8. #8
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Agreed.

    On the issue of readability, consider:
    Code:
    <a href="something.html" style="background-color: silver;color: black;border: 3px inset silver;display: block;width: 80&#37;;overflow: scroll;white-space: pre;margin: 1em;max-height: 50em;font-family: monospace;padding: 1em;	height: 5em;width: 90%;margin-left: 5%;margin-top: 1em;padding-top: 1em;text-align: center;font-size: 90%;font-style: italic;padding-bottom: 2em;margin-bottom: 2em;">Text</a>
    Versus:
    Code:
    <a
      href="something"
      style="
    	background-color: silver;
    	color: black;
    	border: 3px inset silver;
    	display: block;
    	width: 80%;
    	overflow: scroll;
    	white-space: pre;
    	margin: 1em;
    	max-height: 50em;
    	font-family: monospace;
    	padding: 1em;
    	height: 5em;
    	width: 90%;
    	margin-left: 5%;
    	margin-top: 1em;
    	padding-top: 1em;
    	text-align: center;
    	font-size: 90%;
    	font-style: italic;
    	padding-bottom: 2em;
    	margin-bottom: 2em;
      "
    >
      Text
    </a>
    But you're right, generally it's better to use a class or a function when things get large enough to require this.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  9. #9
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    I think I would prefer the single line approach for skimmability.

    I could quickly scroll through my code to find all <a tags, for example.

    Once you start doing that, it becomes like CSS in the middle of the page which wouldn't be expected and would throw off the overall layout. Just imagine doing that within a tabbed section

    I certainly can see your point, though.


    Also, I'd say it should be placed at the end of the tag... like...

    <img src="1.jpg" height="30" width="40" style="[500 characters can go here and you can still easily read all other attributes....">
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  10. #10
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    You can still do that... note how the <a is at the highest level of indentation in the tag.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

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
  •