Hi Guys,
I have a question about CSS. I have a class called .cal_event
This basically controls the formating within a calendar for me.
I want to duplicate this so that I have four variations of this class
.cal_eventAB
.cal_eventCD
.cal_eventEF
.cal_eventGH
Each of these are the same apart from the background colour.
Within my HTML I want to reference these classes so I have the row
<td class="cal_event${ITSEQ}">
The end of this row${ITSEQ} is a field in my database that shows a set of initials. Eg AB, CD, ED or GH.
So in theory, if my data shows a record with the ITSEQ = EF it should use the correct class for that.
The problem is I think my line of code is incorrect as it doesn't seem to work.
Potentially this could be ok, but the key problem here is that in the HTML you are suggesting hardcoding the AB or CD part of the class.
I need this to be a field which then gets read, and if this field contains CD then the class is cal_eventCD. If the field contains AB then the class resolves to be cal_eventAB
Potentially this could be ok, but the key problem here is that in the HTML you are suggesting hardcoding the AB or CD part of the class.
I need this to be a field which then gets read, and if this field contains CD then the class is cal_eventCD. If the field contains AB then the class resolves to be cal_eventAB
I'm sorry, that's dumb. If you can code class="cal_eventCD", why can't you code class="cal_event CD" if a certain conditional is met?
I've switched careers...
I'm NO LONGER a scientist,
but now a web developer...
awesome.
maybe I'm missing something here?
The problem isn't setting the class to be hard coded to CD. It's simple to type that in.
But I want the class to be cal_eventXYZ where XYZ is the content of a field. Not hardcoded.
I thought I could simply reference the field e.g. class="cal_event${ITEMP}" but this doesn't work.
I really don't understand. It is a variable written in a server-side language? Looks like a SMART syntax... Anyway, how your generated HTML code looks like? What you see on your View Source Code? That is important...
Bookmarks