• seamsters

    (@seamsters)


    Hi, I’ve currently got an image placed via style sheets into the background of the header (code below). I’ve been trying to figure out a way for an “alt” style text box to appear, saying something (go back to main page). I can’t figure it out as it seems that alt doesn’t work on the “div” tag, are there any ideas how to do this?

    Thanks,
    Leo

    #header { margin: 0 !important; margin: 0 0 0 1px; padding: 0px; height: 262px; width: 760px; }
    #headerimg { margin: 0px 0px 0; height: 262px; width: 760px; }
    #headerimg { background: url(‘<?php bloginfo(‘stylesheet_directory’); ?>/images/personalheader.jpg’) no-repeat top;}

    </style>

    <?php wp_head(); ?>
    </head>
    <body>
    <div id=”page”>

    <div id=”header”>
    <div id=”headerimg” onclick=”location.href=’https://seamsters.net/&#8217;;” style=”cursor: pointer;”></div>
    </div>
    <hr />

Viewing 3 replies - 1 through 3 (of 3 total)
  • fruitfly

    (@fruitfly)

    As far as I know, there is not a way to add an alt to a CSS called image, since it’s not an element of the page as such, but the design.

    You should be able to add a title to the div though to (I think) get the effect you’re looking for.

    <div id="headerimg" title="Header" onclick="location.href='https://seamsters.net/';" style="cursor: pointer;"></div>

    Edit: Tested it myself, and yeah, it works. ??

    Thread Starter seamsters

    (@seamsters)

    Great, worked like a charm. Thanks a lot.

    fruitfly

    (@fruitfly)

    D’oh! You were too fast for my edit. ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to do Alt for Header IMG’ is closed to new replies.