Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 8 of 8
  1. #1
    Junior Member
    Join Date
    Jun 2011
    Posts
    6
    Member #
    28110
    Liked
    1 times
    This is my first post here so first of all, hello!

    I'm seeking some advice on created a menu that uses an image to symbolise each option and has text underneath with the name.

    I usually use an unordered list when I create a purely text based menu, but just wondered how to put the image above the text, not render the text as part of the image (I'm using @fontface so there would be no benefit) and make sure that when the user clicks on either the image or the text if goes through (and indeed both reflect hover state).

    I'm sure its fairly simple but my brain is a bit fried right now! Any help you can give would be much appreciated!

    Many thanks

  2.  

  3. #2
    Junior Member
    Join Date
    Jun 2011
    Posts
    6
    Member #
    28110
    Liked
    1 times
    Just to clarify, I think I'm essentially asking, can I have and image and a bit of text as an li ? Just one stacked above the other.

    Otherwise, could I have a div as an li?

  4. #3
    Senior Member Webzarus's Avatar
    Join Date
    May 2011
    Location
    South Carolina Coast
    Posts
    3,322
    Member #
    27709
    Liked
    770 times
    if you define the div of the li as a display:block and set the image as a backround with no-repeat.. allow for padding on the bottom for text...it should work...

    using the dislay:block; will also allow you to define the a:link and a:hover to perform as original post.

  5. #4
    Junior Member
    Join Date
    Jun 2011
    Posts
    6
    Member #
    28110
    Liked
    1 times
    great stuff, I'll give it a go. Thanks!

  6. #5
    Junior Member
    Join Date
    Jun 2011
    Posts
    6
    Member #
    28110
    Liked
    1 times
    Just tried it and it works really well! Thanks Webzarus!

    I'm going to go back and make the code lighter later on. At the moment I have:

    <li><div id="buttonHome"><a href="index.html"><p>home</p></a></div></li>

    The div has the background image, no repeat, but in order to get the text to move down I had to create use a p class and add padding to that.

    Is this bad practice? I'm primarily a designer, but I want to make sure that my code is light and follows web standards.

    Thanks again

  7. #6
    Unpaid WDF Intern TheGAME1264's Avatar
    Join Date
    Dec 2002
    Location
    Not from USA
    Posts
    14,485
    Member #
    425
    Liked
    2783 times
    Use padding instead.
    Code:
    li#buttonHome {padding-top:  (the height of your image + 10 pixels or so of buffer);}
    ...
    ...
    <li id="buttonHome"><a href="(actual site root)">home</a></li>
    You got pretty close, though! By the way, you want to refer to the actual root of your site rather than index.html for SEO reasons (specifically, to avoid duplicate content issues).
    If I've helped you out in any way, please pay it forward. My wife and I are walking for Autism Speaks. Please donate, and thanks.

    If someone helped you out, be sure to "Like" their post and/or help them in kind. The "Like" link is on the bottom right of each post, beside the "Share" link.

    My stuff (well, some of it): My bowling alley site | Canadian Postal Code Info (beta)

  8. #7
    Junior Member
    Join Date
    Jun 2011
    Posts
    6
    Member #
    28110
    Liked
    1 times
    just seen that the rollover state doesn't seem to work in Firefox. Any ideas?

  9. #8
    Unpaid WDF Intern TheGAME1264's Avatar
    Join Date
    Dec 2002
    Location
    Not from USA
    Posts
    14,485
    Member #
    425
    Liked
    2783 times
    You could add it to the link itself:
    Code:
    li#buttonHome a:hover {background:  (whatever your background image or color is);  color:  inherit;}
    If that doesn't work for you, throw your page up on a web server and include the link so we can have a look at it. It won't count as link dropping because a mod specifically asked you to do it.
    If I've helped you out in any way, please pay it forward. My wife and I are walking for Autism Speaks. Please donate, and thanks.

    If someone helped you out, be sure to "Like" their post and/or help them in kind. The "Like" link is on the bottom right of each post, beside the "Share" link.

    My stuff (well, some of it): My bowling alley site | Canadian Postal Code Info (beta)


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 07:31 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com