1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Quick question on changing text color in the default twenty eleven search box :).

Discussion in 'WordPress' started by Submerged, Dec 22, 2011.

  1. #1
    Hey guys, just a quick question --

    I'm running the latest WP with twenty eleven. Right now I'm messing around with the default search bar. I've managed to figure out how to change the size, shape, background color, etc. BUt the one thing I can't figure out is how to change the color of the default text in the bar before you click it ("Search"). It starts as a light grey and I'm trying to edit that.

    If it helps, I'm pretty sure it's modified under the "#branding #searchform #s" section (I was able to modify it's size under that, just not it's color). Hopefully it's a quick fix :).

    Thanks!
    - Submerged

    EDIT: I've figured out how to do that by adding some cool HTML 5 things to my searchform.php page:

    
    <style>
    input::-webkit-input-placeholder {
        color: #ffffff;
    }
    
    input:-moz-placeholder {
        color: #ffffff;
    }
    </style>
    
    	<form method="get" id="searchform" action="<?php echo esc_url( home_url( '/' ) ); ?>">
    		<label for="s" class="assistive-text"><?php _e( 'Search the Site . . .', 'twentyeleven' ); ?></label>
    		<input type="text" class="field" name="s" id="s" placeholder="<?php esc_attr_e( 'Search This Site . . .', 'twentyeleven' ); ?>" />
    		<input type="submit" class="submit" name="submit" id="searchsubmit" value="<?php esc_attr_e( 'Search' , 'twentyeleven' ); ?>" />
    	</form>
    
    Code (markup):
    However, it still doesn't seem to be working on Firefox 7; I double-checked the code on a few sites, and it seems to be valid. Any ideas?
     
    Last edited: Dec 22, 2011
    Submerged, Dec 22, 2011 IP