• On one of my blogs I want to display some of my categories with a drop down categories. I have done so using this code

    <form id="categories" action="<?php bloginfo('url'); ?>/" method="get">
    <?php
    	$select = wp_dropdown_categories('show_option_none=**Reviews by Genre**&include=15,17&show_count=1&orderby=name&echo=0');
    	$select = preg_replace("#<select([^>]*)>#", "<select$1 onchange='return this.form.submit()'>", $select);
    	echo $select;
    ?>
    	<noscript><input type="submit" value="View" /></noscript>
    	</form>

    I am now trying to style it with CSS and am using this CSS to do that.

    form.categories {
      text-align: left;
      padding-right: 10px;
      background: #F7F7F7;
      border: 1px solid #F2D6D3;
      width: 170px;}

    My problem is that it’s not working. When I refresh the screen nothing happens. Am I missing something in my code? I’m positive I have everything correct. Help would be greatly appreciated.

    Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • Well, change the CSS to call the ID of the tag, not the class.

    form#categories {

    }

    or change your XHTMl form tag to say
    <form class=”categories” …>

    In other words, you CSS is not being called by from the XHTML.

    Thread Starter crysacraig

    (@crysacraig)

    Thanks for responding cupid…I tried your first solution..didn’t work, so I tried the second. It didn’t work either. I’m stumped.

    <form id="categories"
    This tag is calling for an ID. You will need your CSS to reflect the same ID.

    form.categories {
    This CSS is calling for a class, not an ID. The CSS should say
    form#categories {
    and not
    form.categories {

    get rid of the “form” text in front of your CSS is this doesnt work.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘What am I doing wrong? Need some CSS help!’ is closed to new replies.