Multiple Classes In Html - you can use more than one at a time
jlhaslip
Jan 12 2006, 06:57 PM
Multiple Classes in Css Styles
Classes are used in html pages to give certain defined attributes to elements. They are useful when the attributes are to be used in more than one place on a page. (Named Id's are only allowed once per page, but I digress... might have a tutorial on that some day.) Sometimes you want Red text and sometimes you want Bold text. Easy enough to do, simply define a class and apply it to the element you want red or bold. Use this class where you want on the page, since classes are enabled to be used in several spots, for different uses on a page. Meaning you could apply the class to h3 tags and selected spans, for example.
CODE
.red {color:red} .bold{font-weight:bold;}
Once in a while, you want Red and Bold text. Does this mean you must define a third class and use it? Nope. Css allows you to apply multiple classes to the same element by including both (in this example) classes to the element.
CODE
<p class= "red bold">red and bold</p>
Be sure to leave 'white space' between the class descriptors or the method will fail. ie: a minimum of one blank space between 'red' and 'bold'.
Here is a sample link to show whether it will work in your browser. Notice that this file shows the Multi-class being used in both paragraph and span tags, and twice on the page as classes are designed to do.
This code has been tested and confirmed working in the following Browsers: Opera8, Mozilla 1.7.3, IE5 Win, and IE5 Mac, with no hacks required, so it should work in most browsers.
I modified that sample file above to include your css and code. I added one td tag also, to show that the first css descriptor does actually work.
Your css changes the colour of the first table cell because of the reference to the id = mini for the cell. The cell next to it reverts back to black because of the first line of your css where the td's colour if defined.
The id=mini can only be used once on each page, whereas the class = red can be applied as many times as you want. That is a signifigant difference between using the id= and the class=.
Any guess to what would happen when id= mini and class=bold?
So now the first cell has id=mini (to make it red) and class = bold (to make it bold), so it could be done using both an id and a class.
Except, it can only be done once on a page, and we now have three things to deal with. One name-id and two classes. If we drop the name-id, it can all be done with the two original classes anyway, so how come the single use id??? I would use classes only.
Nice and detailed tutorial.. I have never tryed anything like that but I will definatly try something like that .. Great job keep up making such tutorials .. Are you very good in such things because I sometimes need help when making something with CSS.. and I have nobody to ask for it ..
If you new at HTML you could go here http://www.funkychickens.com/html.html that site really helped me. They are realllllllllllly out dated and i mean REALLY outdated lol but other than that its a good site to teach you. Here is some info about their site
QUOTE
About Funky Chickens HTML Help!
Funky Chickens was created in December 1999, to help teach HTML (HyperText Markup Language). HTML is made up of special codes that add the effects that make your website colorful, cool, and professional looking. We have divided the codes into sections to make it easier to find them. There is an index & glossary for you to locate and understand the various codes. If you have a specific problem, try checking out the "Questions" section. We really appreciate your coming to our site, we believe our site will be a useful reference.
Welcome to my turoial on how to start multiple programs using one shortcut. You may probably be
wondering how this is possible. Well this tutorial will use a language from MS-DOS called batch. I
am not sure whether it is "language", but I do know that it is a way to program for MS-DOS. Batch is
simply a way to run several MS-DOS commands with just one command. All batch files are run through
Command Prompt, but they can be accessed with shortcuts also. Here are a few requirements for this
tutorial. Requirements Windows XP (I tested this on XP, but it should work on m...
If you are a novice web designer, but want your site to look advanced and proffessional, then what
better way to do so than to use HTML tables? HTML tables are a really easy way of formatting your
text, to make your ste look proffesional. It looks good, and its easy, what more can you ask for?
You have to use the tag, so first lets start off with: HTML Table > /table > In
between theese two tags, we will add the data for the table, using the tags and . =Table
Heading (Title) =Table Data (what you want in the table) =table row (new row) So, lets ...
Pre-requisite: HTML, inline frame tags 1 Attachment(.zip) included. Updates : 29-12-07: Doctype
added in example files (Advised by jlhaslip) Designing a whole website takes a lot of planning
and organization. Designing a proper navigation system is a basic step in building your website. If
you are developing webpages in html you would have observed that as you go on creating pages it
becomes difficult to maintain the links to the pages. This article will guide you in developing a
common navigation menu for your website. It describes three ways, so if you don'...
like in the topic, here is a description how to change the Backgroundcolor "On The Fly", by klicking
on a button or radio-box first, we ned the html-and body-tags, create a new html-file on your
desktop and write the following: QUOTE <script language = "JAVASCRIPT">
browser interpretation: html - tag means "hey, browser, here comes HTML" in the body-tag you define
the looking of your site. you can add things like "bgcolor" for the background, "text" for the
textcolor and link / alink / hlink / vlink to define the linkcolor ( ) the scripttag i...
There is another Topic about writing 'clean' HTML code posted elsewhere on the Forum.
I'll edit this Topic and add the link so you can review it on your own, and there is no need for
me to comment on it in this thread, but the purpose of this Topic is to introduce a pair of
functions which can be used for making sure that the HTML output from my scripts is readable when a
view-source is reviewed. Two handy functions are included here. They work together quite nicely,
and I will start this Tutorial with a short summary of the reasons for their 'being...
Html Legend
- Learn how to create a handy legend with HTML! (9)
I think this is pretty neat... good for those people who maybe aren't that great at designing
things but still want something to look nice.. CODE <fieldset> <legend>Legend
title</legend> Content </fieldset> try it in note pad.. it looks nice...good for
forums, sign up forms......
Hi, there are many tutorials about this, but i would like to type the steps i followed in order to
get cakephp working on my user public_html folder. as many of you probably know, if you have
apache's userdir module loaded, you can put your web pages on /home/user/public_html , and
access them with the url: http://localhost/~user/ . I really prefer this, so all my web pages are
on my personal home, but how to configure cakephp to work with these paths, i got a hard time with
this, but finally got it!. here's how: in case you don't have apache2's u...
HTML Span Description The span tag is quite the handy tag to have at your disposal. You can use
it for everything from Text Formating, to creating a scrollable text area. When combined with CSS it
becomes an easy-to-use tool for making your website as uniform as possible, as your not bogged down
with tags for every heading and title on your website. Try It Out CODE <html>
<body> <div class="content"> <span class="heading1"> Heading
or title goes here. </span><br><br> All the content insi...
Description I find that it is often difficult to write a sentence backwards, but thanks to HTML, I
can now complete this task in only a few seconds. Now the only problem is it is very difficult to
read... Try It Out Welcome to one of the most useless functions of HTML. The tags enable you to
write a sentence backwards. The code is quite simple. CODE <bdo dir="rtl">I
find that it is often difficult to write a sentence backwards, but thanks to HTML, I can now
complete this task in only a few seconds. Now the only problem is it is very difficult to r...
NOTE: Don't use a rich text editor* for writing HTML code! Use Notepad in Windows,
SimpleText in Mac or TextEdit in OSX, but you must set the following preferences for the HTML code
to work! In the Format menu, select Plain Text. Open the preferences window from the Text
Edit menu, then select "Ignore rich text commands in HTML files." Start Creating Your Own HTML
File You can either use HTM or HTML file extensions. For more information, visit:
http://filext.com/file-extension/htm for HTM or http://filext.com/file-extension/html for HT...
Ok, I will teach you how to create a simple HTML editor that runs online with buttons that add HTML
tags. Before we start: You should have basic knowledge of these languages. HTML/XHTML
Javascript PHP You will need Ability to use filesystem functions. Chmodding abilities
Features of Editor Online PHP safe Full HTML support A Few Bad Features Can only create new
documents or overwrite Fairly unsafe Now we are ready to begin. The PHP Script This will be
our PHP script that we will use to make the file. Make a file called save.php Here is the...
Ever wonder how to make those stylish forms you see everywhere? Well now it's your change to
learn. This short tutorial will show you how to do exactly that. Here is a bit of css to spice
up the form. I have included comments to explain what classes will change what in the forms.
CODE <style type='text/css'> .form table { background-color: #187cae; }
/*The following css class will change the table cells within the .form div */ .form td {
background-color: #bbe0f4; padding: 3px; border: 0px; ...
Ever since I connected a program I made in Visual Basic to MySQL database, I had an idea to create
some sort of a status page... And I did that, where I updated my connection status every 60 seconds,
updated my Winamp playlist, and several other interesting things... Then, I figured I could create
an image, and display all that info, and show it on forums, as a signature... And I made a great
PHP script, that look real fancy, and does the job perfectly... So, I was adding the reference to
http://status.galahad.trap17.com/stat.php to all the forums... BUT (there's ...
How to Group Multiple Sets of Data in Microsoft Excel 2007 Sometimes you may open several
workbooks and work with a number of the same workbooks at a time. You can open this group of files
with Microsoft Excel 2007 simultaneously. But you have to define them as part of a workspace, and
save them in a single Excel 2007 file. To do this, follow below steps: 1- Click On the View tab and
then in the Window group click Save Workspace. The Save Workspace dialog box appears. 2- In the File
name field, type your work name and then Click Save. 3- At the top-left of window, C...
Today, I will show you how to make a sig rotator similar to mine (refresh a page with my post, and
you will see a different sig each time). We will use the sig rotator to display random sigs here at
trap17. Create a folder called sig.png Actually, the folder can be called anything, but since we
will be using the rotator here, it has to be called sig.png because Invision Power Board may not
allow weird extensions. You can replace png in sig.png with any valid image extensions such as gif
of jpg. Create a file called index.php If you need help renaming a file to ....
Well, I decided to try and help out some of the users here who might be unexperienced in HTML, so I
condensed the begginer's HTML course at my website. Here it is... Lesson 1 HTML means Hyper
Text Markup Language. HTML is a very common language used for many websites, is the base for more
complicated and powerful langauges like php, HTML can seem hard, but you will find it is one of the
easiest langauges one can learn. The core of HTML is the tag, a tage is just a set of two
arrows-like brackets created by hitting Shift and the comma key, or Shift and the period...
Whilst searching around for help to setup cutenews blog I came across a way to use php in html pages
- lo and behold it works! so I thought I'd share it with you all (Unfortunately I can't
remember the site so I wrote this up a couple of minutes after I did it:) ). This method requires a
web server with apache installed. So, luckily for us all this covers the whole of Trap17... even
Qupis /tongue.gif" style="vertical-align:middle" emoid=":P" border="0" alt="tongue.gif" /> Just
to make the point, this is in no way a difficult task and it doesn't requir...
A simple tut to make a simple shoutbox. Let me jump right in. First of all you need the standard
equipment for PHP, an IDE like XAMPP and an editor like PHP EDITOR 2OO7. Were going to make a
simple guestbook using three files, webpage.php, shout.php and shout.txt. Webpage.php can be
changed to whatver you want, it will be the page on which the guestbok is shown, you could even use
this code and add it to another php page n your site. Shout.php is the proccessing page and
shout.txt is where the shouts are stored. Firstly we need to make the visual design of the box....
This code: CODE <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd"> <html> <head>
<title>HTML 4.0 Strict document</title> <meta
http-equiv="content-type" content="text/html;charset=utf-8" > <meta
http-equiv="Content-Style-Type" content="text/css" > </head>
<body> <p>... Your HTML content here ...</p> <p>... More
HTML content here ...</p> </b...
Joomla is one of the most powerfull CMS sistems around. It is free under GNU/GPL license and
everyone with simple knowlege of webdesign (and even without it) can use it for it's website.
For now the only way i know on how to design a template in joomla is by using Dreamweaver and Joomla
(joomlasolutions1.0.mxp-dreamweaver.mxp) extension for dreamweaver! Template design in joomla
is quite simple really. This template that i'll show you is the most simplest of them all, but
it's enough for one to learn Basics of template design. Further notice is that this...
Ok. Well i am writing this as a series of tutorials i will be doing on this subject, so enjoy. I
hope this helps. Introduction to HTML and CSS
HTML and CSS are to work together. HTML is what puts the characters on the page, while CSS is what
makes everything look outreageous! For instance, I would use HTML if i wanted to put "Trap17 is
the poop!" onto my page, although if i wanted to make it look nice like this by adding a font,
and maybe some color, then I would use CSS. Learn the HTML. Ok this is my lit...
Hi everyone, Ok before I start, I want to let you guys know the meanings of some of the
terminologies I will be using in here. Boot loader is a small program which the operating system
places on the selected partition (in most cases, the MBR ). it is a small program that loads the
operating system into the computer’s memory when the system is booted and also starts the
operating system. So, before you can think of configuring your PC to have multiple boot, you should
also know how to play around with 'em boot loaders too. And you should also make sure that y...
What is HTML? HTML (hypertext markup language) is computer language that is used to webpages. It
can be confusing to understand for some of us kids. HTML pages are text files that has of HTML tags
(they can place the text or images whereever you want to place it), and text you can place between
the tags so the text willshow up on your page when you put it on the WWW. Tags are instructions that
tell your browser what to show on ya website. They break up your webpage into basic sections. All
tags start with a (right bracket). If you are a starter you need 4 tools A...
Have you ever wondered how people have a normal link but all it does it take you to the middle of a
long page? well here is a solution DEMO: Here Ok well first off for the link it will be just
like a normal link code except you wont put a http://URL.com/file.php it will look somthing like
this QUOTE name ">Click This Link! there must be a # sign in front of this to work..
now, for the content that the person will be re-directed to after clicking the link QUOTE name
"> the items in bold is what you need to change QUOTE name "> i...
Well i thought it was time to bring in issue 2 of html tips and tricks and i found a very
interesting html coding which i thought was funny as hell its called Preventing Search Engine
Indexing this coding is used to keep your website from being index why i don't know why you
don't want you website listed unless it someone stupid as in telletubbies.com but heres the code
This tag tells the robots not to index this page and not to follow any links within the
page. QUOTE This tag tells the robots not to index this page, but follow any links wit...
WEll its been awhile since i did so i will put up some more useful html tips and tricks here on
trap17.com Ok for trick actually, want to know how some websites got those ool icons put on their
website link in the favorites folder well here you go in 3 quick steps. 1. create an image then
shrink it down to 16x16 and save it as avicon .bmp. 2. then change it to .ico, when is the file
reconizing it as a icon., if you are having problems saving it, there are some resources out there
that can change it for you. 3. load the image to your website and add this tag in betwee...
Well by the many views i have seen on my web design issues i should go into new territory, so im
going start with some useful xhtml info for you web design fenatics, the info i present to you is
from other websites so be warned it might or might not work all depends but lets start off with the
basic info for using xhtml. Also this tutorial is for beginners so i won't be doing any xml
info due to it being a more server side then actually webdesign 1. DOCTYPE this is used to tell
the browser what kind of infomation it will be displaying. nothing as really changed...
Todays issue we are going to talk about a bunch of good newbie stuff. The first is meta tags to
make it easy use a generator, from my searches on the internet ther are soe many meta tags to use
its not even funny but for those whoe like them is are the more common ones that are used for a
website. QUOTE also for a dynamic look using the meta this called page
fading so to speak, what it does when you click on a link the website will fade for a duration of
time to the next page on your site warning it doesn't do anything when you first cl...
this little trick i though was useful it used to send a visitor to another page using meta tag and
it sends the user to another page with in a few seconds for example you will go to the new page in 5
seconds CODE <META HTTP-EQUIV=REFRESH
CONTENT="5;URL=http://www.yoursitehere.com"> and for those have a good knowledge
of javascript they could use this script right here CODE <html> <head>
<title>Refresh Page</title> <script language="JavaScript">
<!-- var time = null function move...
Looking for multiple, classes, html, time
Searching Video's for multiple, classes, html, time
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE
forum, Create your own topics, Ask Questions, track topics, setup
subscriptions & notifications and Get a Free Website w/ Email and FTP.