Help understanding this code

I have been directed to the following section of code as the area I should focus on to modify for my needs:

if($showLegend == 'yes'){ $output .= '<div class="wpsbc-legend">'; $output .= wpsbc_print_legend($calendarLegend,$calendarLanguage); $output .= '<div class="wpsbc-clear"><!-- --></div></div>'; }

The above code supposedly produces a calendar legend where the legend items display one above the other.
My first question is, from the code above, what puts the items above each other?
My second question is, how would I modify it so the items are Inline (next to each other on a single line)?

Look at the Css, that is going to make the difference on it displaying inline or as a block element.

Hi Astonecipher,
I have customized the CSS to do everything else I want but that does not control the layout of the legend.

Here is the html code it is producing for the display

[code]

Available

Booked

[/code]

I know how to modify the above code to produce an inline version of the legend but I don’t understand how the previously mentioned PHP is producing this html. If I did then I could modify the PHP to display the legend items inline rather than one above the other. The CSS does not control the layout of the legend in this instance.

The code calls this function, wpsbc_print_legend that has the html stored. However, CSS controls the layout always, unless it is default html behavior, such as a label being classified as an inline element, or a div being a block element.

Open your browser tools and inspect one of the legends. CSS is pulling a rule from somewhere.

Sponsor our Newsletter | Privacy Policy | Terms of Service