Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Jun 2002
Posts: 121
Member
Member
Offline
Joined: Jun 2002
Posts: 121
This is mainly intended for use on my Ubb although the knowledge could be very useful.

I understand using CSS that I can change the colour's of form element's such as radio box's and button's.
Currently I am testing the CSS to get the right look within my form's but I have a problem.
I am using the below code to colour in my forum button's:
_________________________

INPUT {
background:rgb(255,0,255);
color:rgb(0,0,0);
border-style:solid;
border-color:rgb(0,0,0);
border-width:2px;
}
_________________________

If you ignore the colour's you will see that it does infact change the colours of the button's but it also changes the radio button's colour etc too which I dont want.

What code would I have to use within my CSS so that it only effect's the button's on my Ubb such as "Add reply" "Add New Topic" "Spell Check" "Add Reply" etc.


I Cannot Support Ubb Via ICQ or MSN.
Not because I dont want to its just I cant. tipsy
Sponsored Links
Joined: Sep 2000
Posts: 4,211
Master Hacker
Master Hacker
Joined: Sep 2000
Posts: 4,211
If you look at the CSS and also at the HTML, you'll realize why things happen as they do. The code you posted says to take all INPUT elements and style them with the given properties. OK, good.

However, the INPUT element includes many different form controls, so you have to be careful in how you use it. We're talking about text fields, password fields, checkboxes, radio buttons, submit buttons, reset buttons, and even a couple of other kinds of buttons. To be blunt, there's no easy way around this to do what you're trying to do.

You'll have to make a class and then edit the templates manually, applying to class only to the elements that you want styled. Hope this gets you started in the right direction.

Joined: Jun 2002
Posts: 121
Member
Member
Offline
Joined: Jun 2002
Posts: 121
Yeah I read about the modifying part.
What files contain the templates for the posting sheets ie the ones with the buttons and how do I make a class for them?

So Id open up the file find the forum buttons and add something in like class="blag"

And in my css rather than put input Id type blag?

Am I in the right direction.


I Cannot Support Ubb Via ICQ or MSN.
Not because I dont want to its just I cant. tipsy
Joined: Sep 2000
Posts: 4,211
Master Hacker
Master Hacker
Joined: Sep 2000
Posts: 4,211
It's been awhile since I've edited the files, but I believe that you'll need to open up /nonCGI/Templates/public_new_topic_form.pl, public_new_reply_form.pl, and public_edit_post.pl.

Here's an example of your code made into a class and condensed. I can see you've got some reading to do. smile
[code][/code]

Joined: Jun 2002
Posts: 121
Member
Member
Offline
Joined: Jun 2002
Posts: 121
Ok I think Ive got it:

[code][/code]And added the class type above!

Is this what Id have to add to every single form which has a button in?

And after that I just add to my css class=button rather than strictly input?

Hope Im in the right area.


I Cannot Support Ubb Via ICQ or MSN.
Not because I dont want to its just I cant. tipsy
Sponsored Links
Joined: May 2000
Posts: 1,356
Addict
Addict
Joined: May 2000
Posts: 1,356
input & select & textarea are pre-declared classes in css. Think it like this;

when you use

input {
/* ... */
}

in your css, you have to use a "input" tag to use this style. And when you define a class named "showSomeClass" you have to put it somewhere in your html to use it.

As a result; if you want to use a user-defined class for your input tag, you must use it in every input tag:


Joined: Jun 2002
Posts: 121
Member
Member
Offline
Joined: Jun 2002
Posts: 121
Yeah I know thats what I was getting at butthanx man. smile


I Cannot Support Ubb Via ICQ or MSN.
Not because I dont want to its just I cant. tipsy
Joined: Sep 2000
Posts: 4,211
Master Hacker
Master Hacker
Joined: Sep 2000
Posts: 4,211
quote:
Originally posted by jeologic:
input & select & textarea are pre-declared classes in css.

They're elements, not classes.

Joined: May 2000
Posts: 1,356
Addict
Addict
Joined: May 2000
Posts: 1,356
yes, they are elements... sorry...


Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
AllenAyres
AllenAyres
Texas
Posts: 21,079
Joined: March 2000
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)