Introduction
This tutorial will show how one goes about modifying the layout of Piano Content Recommendations using the Piano Content UI. The tutorial is part of a series of tutorials on Piano Content Recommendations. The two other tutorials in the series are:
-
Piano Content Recommendation Tutorial
-
Piano Content Recommendation Config Tutorial
This tutorial assumes some basic understanding of CSS and that you have completed the first tutorial listed above or already posses the knowledge.
Generating the Javascript Code from the Default Javascript Template
Before we start editing CSS, we will generate the HTML that we will use as our target output. Start with the default JavaScript template and review the HTML generated from that template in the HTML tab.
We will use the default JavaScript template below as the starting point for generating the recommendation HTML.
|
Below, we have integrated the generated HTML into a complete HTML web page and swapped the click and image URLs for test files on our local computer. The item structure (the div with the class attribute set to "item") repeats three times because we set the widget size to 3:
|
Whatever CSS we were to enter under the Styles tab in the UI can now be tested here by inserting in the html code above where it says // HERE IS WHERE YOUR CSS STYLE WILL END UP.
Incremental CSS Changes
Starting with no CSS at all, we will, step by step, do increasingly more and more sophisticated modification to the widget layout using the html code above as our test framework.
Not Applying any CSS Style at all
Let's start by not doing any change. That is, by not adding any CSS at all. The result can be seen below.
Notice how the items were displayed vertically, that there are no action upon hoovering the mouse above any of the items, and the links are underlined and have the browser's default font type and size.
Going from Nothing to the Default CSS Style
Below we see how we can make the items be listed horizontally rather then vertically. The key here is the left floating.
|
Below we see how one can make the background change when hoovering the mouse above one of the items.
|
Below we remove the underlining of the link with the anchor text (text-decoration: none) and set the text font type, size and color of the title (the title appear within a h3 element, hence why we do the settings for this element).
|