473,750 Members | 2,458 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How do I reference an Object ID in my CSS?

Hello,

This is my first post to this group. A little background first: I'm not
not new to web-design, but new to manual coding :>) I'm trying to move
from total dependence on FrontPage to more manual coding and
positioning. So far I think I've done OK for a newbie (you can go to
http://home.comcast.net/~vikenk to see my latest site, which is based
mostly on a CSS). But now I have a question:

I'm trying to position a Java Applet using CSS. I've given my applet an
ID, as follows:

<applet code="slideways .class" ID="slide">

Now, when I want to position this in my CSS sheet, how do I reference
the ID? Would I write something like:

id.slide {height;width;m y positioning info}

I've gone to W3 Schools online and foud nothing specific about this.

I suppose the big-picture question here is: Would/Should I even do that
at all? Would it be more "proper" to just create a Style in my CSS then
apply that to the Applet? So then my CSS would include:

..slide {height;width;m y positioning info}

and my HTML tags would look like:

<applet code="slideways .class" class="slide">

Any replies would be greatly appreciated. Again, I'm still a relative
newbie to CSS and coding, so some of the above may not even make total
sense :>)

Thanks in advance,

Viken K.

Jul 21 '05 #1
3 2660
vi****@aol.com wrote:
Hello,

This is my first post to this group. A little background first: I'm not
not new to web-design, but new to manual coding :>) I'm trying to move
from total dependence on FrontPage to more manual coding and
positioning. So far I think I've done OK for a newbie (you can go to
http://home.comcast.net/~vikenk to see my latest site, which is based
mostly on a CSS). But now I have a question:

I'm trying to position a Java Applet using CSS. I've given my applet an
ID, as follows:

<applet code="slideways .class" ID="slide">

Now, when I want to position this in my CSS sheet, how do I reference
the ID? Would I write something like:

id.slide {height;width;m y positioning info}

I've gone to W3 Schools online and foud nothing specific about this. The way to reference elements by their id is:

#slide { ... }
I suppose the big-picture question here is: Would/Should I even do that
at all? Would it be more "proper" to just create a Style in my CSS then
apply that to the Applet? So then my CSS would include:

.slide {height;width;m y positioning info}

and my HTML tags would look like:

<applet code="slideways .class" class="slide"> Use id, if your element is *unique*, e.g. if the CSS rules are only used for
this specific applet. An id identifies a specific element that only appears
once on a page.
Use class, if the CSS rules (may) apply to several elements that all belong
to this class.
For beginners, using only classes may be sufficient. Advantages of ids are,
that #foo rules have higher precedence than .foo rules and elements with an
id are easier to use when working with JavaScript.

Any replies would be greatly appreciated. Again, I'm still a relative
newbie to CSS and coding, so some of the above may not even make total
sense :>)


As a side note: the <applet> tag is deprecated, you should (or must,
depending of the doctype you use) use <object> instead.
Hope this helps,
Benjamin

--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/
Jul 21 '05 #2
vi****@aol.com wrote:
Hello,

This is my first post to this group. A little background first: I'm not
not new to web-design, but new to manual coding :>) I'm trying to move
from total dependence on FrontPage to more manual coding and
positioning. So far I think I've done OK for a newbie (you can go to
http://home.comcast.net/~vikenk to see my latest site, which is based
mostly on a CSS). But now I have a question:

I'm trying to position a Java Applet using CSS. I've given my applet an
ID, as follows:

<applet code="slideways .class" ID="slide">

Now, when I want to position this in my CSS sheet, how do I reference
the ID? Would I write something like:

id.slide {height;width;m y positioning info}
Do applet#slide {height;width;m y positioning info;}
I suppose the big-picture question here is: Would/Should I even do that
at all? Would it be more "proper" to just create a Style in my CSS then
apply that to the Applet? So then my CSS would include:

.slide {height;width;m y positioning info}

and my HTML tags would look like:

<applet code="slideways .class" class="slide">

Any replies would be greatly appreciated. Again, I'm still a relative
newbie to CSS and coding, so some of the above may not even make total
sense :>)


The key difference between using id and class is that you can have only
one instance of a given id on a page, whereas with class you can have
many. E.g. you can have id="a" and id="b" on a page, but you can't have
id="a" in one tag and id="a" in a second tag on the same page. Whereas
you can have class="a" appear as many times on a page as you wish.

Jul 21 '05 #3
Thank you both very much!

Jul 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
9494
by: Jan Pieter Kunst | last post by:
(apologies if this message is a duplicate -- my news server seems to have problems) Greetings, When using PHP 4, this: // ex. 1 class A { function A(&$obj) {
6
2254
by: Chris S. | last post by:
I'm trying to make a graphical editor and browser for Pickled files. One aspect I'm not sure about is how to detect multiple references to the same data. For instance, say I had the Pickled data: a= b= c= d=
7
1932
by: Nick Zdunic | last post by:
I have a remotable object running in my host application. The host starts up and creates the object. Within a method to start the remote object doing its thing it creates an object. This object reference is passed into another object create within the same
11
2197
by: Doug | last post by:
Is there any harm in passing an object into a method with the 'ref' keyword if the object is already a reference variable? If not, is there any benefit?
4
3408
by: z_learning_tester | last post by:
I'm reading the MS press C# book and there seems to be a contradiction. Please tell me which one is correct, 1 or 2. Thanks! Jeff 1. First it gives the code below saying that it prints 0 then 42. They say that 42 is printed the second time since the value was wrapped in a class and therefore became passed by reference. (sorry for any typos I am a newbie here ;-)
8
2402
by: toton | last post by:
HI, One more small doubt from today's mail. I have certain function which returns a pointer (sometimes a const pointer from a const member function). And certain member function needs reference (or better a const reference). for eg, const PointRange* points = cc.points(ptAligned);
15
2678
by: arnuld | last post by:
-------- PROGRAMME ----------- /* Stroustrup, 5.6 Structures STATEMENT: this programmes *tries* to do do this in 3 parts: 1.) it creates a "struct", named "jd", of type "address". 2. it then adds values to "jd" 3.) in the end it prints values of "jd".
68
4635
by: Jim Langston | last post by:
I remember there was a thread a while back that was talking about using the return value of a function as a reference where I had thought the reference would become invalidated because it was a temporary but it was stated that it would not. This has come up in an irc channel but I can not find the original thread, nor can I get any code to work. Foo& Bar( int Val ) { return Foo( Val ); }
12
3017
by: Bryan Parkoff | last post by:
I write my large project in C++ source code. My C++ source code contains approximate four thousand small functions. Most of them are inline. I define variables and functions in the global scope. The global variables and global functions are hidden to prevent from accessing by the programmers. All global functions share global variables. Only very few global functions are allowed to be reusability for the programmers to use. Few...
275
12349
by: Astley Le Jasper | last post by:
Sorry for the numpty question ... How do you find the reference name of an object? So if i have this bob = modulename.objectname() how do i find that the name is 'bob'
0
9584
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9345
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9259
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6817
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6083
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4895
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3328
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2811
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2228
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.