Viewing 5 replies - 1 through 5 (of 5 total)
  • Hello Art!

    It looks like the id #searchform currently has a width of 90%. This means that to center it you can either increase the width to 100% or have it apply auto margins to the left and right. Try adding:

    #searchform { margin: 0 auto; }

    to your CSS and see if it helps with your issue.

    Thread Starter ArtHughesPhoto

    (@arthughesphoto)

    I can’t tell you how much I appreciate the help. That worked perfectly. I am very new to modify wordpress sites w CSS so I really appreciate the help.

    Is it easy to modify the width?

    Thank you so much Kendall!

    You’re welcome, Art. Glad to help and be sure to mark this topic as “Resolved”.

    And yes, modifying the width is just as easy. You can actually define it in one of several different ways: percentage, pixels, distance relative to line height, etc. In this case you would use something like the following examples:

    #searchform { width: 60%; }

    or

    #searchform { width: 500px; }

    or

    #searchform { width: 15em; }

    …and so on. You can read more about the CSS width property here.

    Thread Starter ArtHughesPhoto

    (@arthughesphoto)

    Thank you so much Kendall. You’ve resolved all my issues and taught me a lot. I really appreciate it.

    Have a wonderful weekend!

    You as well, good sir.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘How to center a search widget using Custom CSS’ is closed to new replies.