|
|
Updated: 11/28/2004 05:44:22 PM (Broken Link? Report It Here) |
|
|
Design Area What is the purpose of the Design Hints and Tips area? Many times one has enough knowledge about a subject to be beyond the need of a tutorial but not enough to know exactly how to accomplish a certain task or reach a certain goal. Often one finds himself needing to learn how to do just one small thing instead of a receiving a full course instruction. And then there are times where you learn something interesting and useful just by browsing around; but without really intending to learn. That's the purpose of the Design Hints and Tips area - to teach you something small, but interesting and useful. To show you how to do just one thing at a time and help you reach your goal. More importantly, to provide you the opportunity to learn something new each day; which is a goal most people envision and strive for. Membership requirements for Giz Gears. This interactive area within Giz Gears does not require an active Giz-Net Network membership in order to participate.
You can use CSS to control background images on your pages. Remember, all CSS scripting should be contained within the HEAD section of your pages.
Note: I did not load an example for this CSS block because it would cause too many changes to my webpage. But feel free to copy the code and try it out on your own website!
Here's an example of how to change various portions of your background colors on your webpages: <html> <body> Background colors have been assigned to a number of pre-assigned elements; in this example, they have been assigned to the H1, H2 and P tags. Note that H2 is attributed with the "transparent" value. It will show no color. Note: I did not load an example for this CSS block because it would cause too many changes to my webpage. But feel free to copy the code and try it out on your own website!
Add comments to your Cascading Style Sheets (CSS) to help guide you later. When first inputting your CSS code, the code may make sense. However, later on it may not make sense when you are trying to edit it. The comments will help you remember why you inputted the code in the first place. As a general rule (works with most known browsers), you would input a CSS comment using forward slashes and asterisks. For example: /* This is a CSS comment */
A gradient background starts out as one color and gradually changes to another color; usually from light to dark or vice versa. To make a gradient background without using an image, you need browser that will read the CSS code and produce the gradient background. Internet Explorer is one of those browsers. For those that are not compatible, all you will see is the page's background color.
The code for the table above looks like this:
<table width="100" align="center" style="filter:progid:DXImageTransform.Microsoft.Gradient(endColorstr='#E7B700',
startColorstr='#EAE4B4', gradientType='0');">
To
highlight the background of your links when your mouse hovers over it,
embed this Style Tag in-between your <head></head> tags: Move your mouse over this link or any other link on this page to see the effect.
CSS can be used to protect your images from the right-click image thieves. Place an image as a background inside a Span Tag. Then place a transparent image over top of it. When someone views the page through their browser, they will see the image just fine. If they right click and save the image though all they will save is the transparent image because it is resting on top of the real image.
Let’s say that your images are stored in the images directory on your
server. There’s an image there named x-men.gif, and it is 32 x 32
pixels.
Now you place the two images on your page using the <span></span> tag:
Copy the code above to your page and change the URL information to match your website. Don’t forget to adjust the width and height code for the transparent image so it is the same size as the original. For example:
Note: I am running a different kind of image protection code on my website so some of you may receive an error message if you try to right-click on the image. But feel free to copy the code and try it out on your own website! Others of you will actually be able to right-click on the image, but when you save the file all you should get is the transparent image.
Dress up your links and give them style with this style sheet. Copy, edit and paste the below code in between your <head></head> tags and all your links on that webpage will have the generated effect. Or you can use an external style sheet if you want the effects to happen on any webpage on your website. <style> Note: I did not load an example for this CSS block because it would cause too many changes to my webpage. But feel free to copy the code and try it out on your own website!
Need some space around a webpage element and don't want to use a table? Try using CSS to get that padding. Use this method to add to spans, tables, forms, etc. It will override any pre-set HTML definitions, such as a table's cellpadding attribute: <table style="padding:1px 1px 1px 1px;"> Or <span style="padding:1px 1px 1px 1px;"> Note: The padding has four elements: Top/Right/Bottom/Left, in that order.
Stylesheets (CSS) offer some great tools to alter the way text is formatted and displayed by Web browsers. Take control of your text elements by using CSS styles to manipulate HTML coding. The following examples are based on local and direct implementation of styles. All of the following can be used with an internal or external global stylesheet.
Declare a font: font-family: verdana,arial,sans serif To implement this kind of formatting, you can use a style, stylesheet, or simply delimit the text in question using a <span> tag, like this: <span style="font-family: verdana,arial,sans serif; font-size: 14px; font-style: italic; font-weight: bold; color: cc0033; background: f3f3f3; word-spacing: 2px; letter-spacing: 5px; text-indent: 15px; line-height: 10px;"> ... Some Text ... </span> Here is how such a formatting operation will output to a browser: ... Some Text ...
Contributions for Giz Gears. If you have a great web design source you would like to share, please let me know! I give credit for all sources of contributions; links, tutorials, downloads, hints, tips, etc. If you would like to see other pages added to this area, please let me know either through email or through the Forum. |
||
|
|
||