Thank you very much for your questions. Most people only want a fish, very few people want to learn how to fish.
1. How did you figure out the correct page id #? Where did that # come from?
You can either do a view source or inspect the page using Firebug or Chrome DevTools. In either case, you want to look for the <body>
element. Correctly constructed themes will call the body_class() function, which adds various class names to the body element, including the page/post ID. Many class names are very helpful when targeting CSS to a particular page. For example, the home page will have a class of home assigned to it. And each page will have a unique number called the page or post ID.
2. How were you able to see the CSS rules? When I use inspect element I do not see it.
The first thing I did was to inspect the search bar itself by right-clicking it and doing an inspect element.
You’ll notice on the left pane of the inspector the code structure. What’s nice about the display is that each element is indented according to how it is “nested” inside its parent element. What I did was look for an element which has a width property assigned to it.
So the element that was first highlighted when the inspector was opened up was a <div>
with a class of search_jobs
. It did not have a width property assigned to it, so I clicked on the parent element, a <form>
with a class of job_filters
. That element also did not have a width property. The next element up, job_listings
did not, but the next element, entry-content
, does. That’s how I found out what was controlling the width. You may need to scroll the pane on the right, the one listing the CSS rules, down to see all of the rules which affect that element, just to make sure you don’t miss the property that you’re looking for. And sometimes the width property that you find might not be the one that you are actually looking for, it could be a high-level parent element. You just have to play around using your web debugger, i.e., the web debugger will allow you to interactively remove or change CSS property values so you can see how the element gets affected.