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 4 of 4
  1. #1
    Junior Member
    Join Date
    May 2011
    Posts
    6
    Member #
    27932
    Liked
    1 times
    HI, I'm wondering if it's possible ot use my css doc for my website to perform the following actions?

    I want all the links to have the same target. The following code seemed to work but now not so much ("centre is the name of the iframe that all of my html pages should open into.:

    a
    {
    target: centre;
    }

    I suppose I can just put the target into each <a> but thought it might be an easier way.


    Also I have a drop down list in my booking form that I'd like to style - is this code corrrect?
    #dropdown
    {
    height: 10px;
    width: 425px;
    background-color:#eeeeee;
    border: 2px solid #000000;
    }


    I has used the CSS doc to style a textarea. And it just wasn't working. BUt lo and behold now it is working. Maybe it takes tme sometimes?

    Tx in advance for any help I can get.

    Thuco

  2.  

  3. #2
    Unpaid WDF Intern TheGAME1264's Avatar
    Join Date
    Dec 2002
    Location
    Not from USA
    Posts
    14,485
    Member #
    425
    Liked
    2783 times
    There isn't a way in CSS to do what you want. Not a bad thought, but it won't work.

    You could theoretically use Javascript to apply the attribute to all of your anchors, or jQuery, something like this, but it won't work for non-JS users:

    $('a').attr('target', 'center');

    And yes, that is the correct way to style a listbox.
    thuco and phillihp like this.
    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)

  4. #3
    Junior Member
    Join Date
    May 2011
    Posts
    6
    Member #
    27932
    Liked
    1 times
    Thanks for that. So the JS code you've given me I would need to put where? In the <head> section?

    $('a').attr('target', 'center');

    What doees all of that code mean?

    I assume the $ is string. What does it mean and why does it come before the rest of the code? then basically we're saying that ('a') or anchor attr (attribute)
    'target', should now be 'centre' - yes?

    Thanks man, once I know where to put it I will give it a whirl.

    BTW, while I've got you... can I use CSS to style an iframe? The target "centre" is an iframe on my index page. I've heard that one shouldn't use them but it just does the job so well for me.

    Can I style it and if so any ideas on what the style attributes are?

    MUCHO Thanks bud...

    Thuco

  5. #4
    Unpaid WDF Intern TheGAME1264's Avatar
    Join Date
    Dec 2002
    Location
    Not from USA
    Posts
    14,485
    Member #
    425
    Liked
    2783 times
    You could, yes. But that's only part of the code. It also requires the jQuery framework (hence the $).

    You can put it in the head, but you'll also want to make it part of a function or some other code. Take a look at the framework, download it, and study it. It will be well worth your while.

    And yes, you can use CSS to style an iframe by using width, height, border attributes, etc. I'm not sure what else you can do with them, though...I rarely use iframes myself (only to link to external content.)
    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
  •  

Search tags for this page

css how to target dropdown list

Click on a term to search for related topics.
All times are GMT -6. The time now is 02:32 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com