
When combined with “screen,” this indicates that the text should use “arial” font.
rule in each line indicates how the text should look depending on where it is being viewed. For both views, the font size remains 12 screen In this example below, the website uses “arial” font and when printed “times” font is used. Css color codes for clover code#
This code below allows you to change the appearance of a web page when it is printed.
The navigation bar will look something like this when finished:ĩ.
The final block contains the text that will appear in your button bar, “Home, Products, Contact, About” is what is used in this example, but these can be changed to any text needed. The next to single lines of code “hover” and “background-color” indicate that mouse cursor hover is active and when a user does hover over a button, the color turns pink. The next block of code indicates that we want the bar to display as a block that is 120 pixels wide and red, the text color is white with 4 pixels of padding between each word and all uppercase. The “float” line indicates that this bar will be left justified on the page. With both set to “0,” the elements appear side-by-side without space creating the look of a solid bar. Margin handles the border around an element and the padding handles the space outside of the border around the element. It appears as a single, solid red bar (rather than four individual buttons) because we have set the “margin” and “padding” to “0” in each case. The red section of the bar turns pink when the mouse cursor hovers over any of the buttons. This code creates a red bar with pink text options. This example makes a bar of four horizontal buttons to help users navigate around to the various pages of your site. The “li” tags before and after each “Example” line indicate that this is a line in a list.Ī navigation bar is simple to create as well. The “ul class” before each example list gives the name that the opening instructions are pointing to and each line will be formatted using the bullet indicated in those instructions. The lines that follow indicate the other example lists named “b, c” and “d” will be using these bullet styles, “circle, square” and numbered “decimal.” This code creates a border that looks like this:Ī simple image gallery uses this complex looking code below.ĭiv.img a:hover img – this line indicates that the list that we are going to create is named “a” and it is using a “disc” shape bullet. border-width:5px indicates that the border, regardless of style, is going to be 5 pixels thick, adjust this by simply changing the value to a larger or smaller number. This example is set to “solid,” however there are many possibilities here from “dotted, double, inset, hidden” to “dashed” try them all and see what fits your website best. border-style:solid indicates the type of border we are using. For this example we’ve written “Sample border one.” So, enter the text you want to appear within the border in the p class line. p.one is referencing the paragraph tab, p class, at the bottom of the code. In this example we’ve created a border that is 5 pixels thick. Use this code below to add a border around text. margin-right:200px indicates how much margin should be between the image and whatever other objects are on the page to the right, for this example we’ve set this image to a 200 pixels margin. You could adjust this with using “right top” or “left bottom,” for example. background-position:center indicates that the image will appear in the very center of your webpage. background-repeat:no-repeat indicates that the image should only appear once. For this example I’ve used a stock photo of an Orca Whale.
background-image:url is the CSS attribute that points to the image you wish to embed.
This is what the code means in layman’s terms: To embed an image you will use the line of code below and adjust certain elements to your specification. Here is a list of nine simple CSS codes that could enhance most any website. But that complexity offers much more sophistication for the aesthetic look of your website. If you are used to using HTML, you’ll notice immediately how much more complex CSS code is. Embed photos to a site, add links here or buttons there, make tables and much more. Just a rudimentary understanding of cascading style sheets can open up new possibilities for the way text and images function on your site. Although CSS code is more complicated than HTML, it ultimately gives merchants much more flexibility in formatting and style for websites.