Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!
  • Guest, before posting your code please take these rules into consideration:
    • It is required to use our BBCode feature to display your code. While within the editor click < / > or >_ and place your code within the BB Code prompt. This helps others with finding a solution by making it easier to read and easier to copy.
    • You can also use markdown to share your code. When using markdown your code will be automatically converted to BBCode. For help with markdown check out the markdown guide.
    • Don't share a wall of code. All we want is the problem area, the code related to your issue.


    To learn more about how to use our BBCode feature, please click here.

    Thank you, Code Forum.

HTML & CSS How to add a description in the center frame every time you click on a tab above

Hi, I built this portal for online courses. I can only use HTML and CSS without scripts. Could you help me add a description in the center frame when you click on each tab from above without clicking on the side buttons that have each one? Thanks in advance.

Hi there,
unfortunately, you would need a bit of javascript to be able to accomplish that, to handle when a tab is clicked on. Here is the basic layout of that
1) grab all the tabs using their class name
2) iterate through each item on that list above and add a click event handler to each of those items
3) in that event handler,
a) grab the element in the center
b) check to see which tab was clicked
c) change text of center element
 
Last edited:
Hi there,
unfortunately, you would need a bit of javascript to be able to accomplish that, to handle when a tab is clicked on. Here is the basic layout of that
1) grab all the tabs using their class name
2) iterate through each item on that list above and add a click event handler to each of those items
3) in that event handler,
a) grab the element in the center
b) check to see which tab was clicked
c) change text of center element
Hi Antero360, thanks a lot for your reply.
Unfortunately, I can't use scripts on this page since is not supported by the platform that I'm working. I need to do this with CSS only.
 
Hi Antero360, thanks a lot for your reply.
Unfortunately, I can't use scripts on this page since is not supported by the platform that I'm working. I need to do this with CSS only.
no, but you can add your javascript code on there, in that third column...that is what that column is for.

1678725174835.png
 
no, but you can add your javascript code on there, in that third column...that is what that column is for.

View attachment 2047
Yes, I can do it in CodePen but I only posted the code there to show at the forum.
I'm working in a workspace called Saba and it don't allow use of scripts. Just HTML and CSS.

When I'm refering to center frame, I'm refering to this. I would like to get a description like this everytime you click on a tab.

1678725761116.png
 
Yes, I can do it in CodePen but I only posted the code there to show at the forum.
I'm working in a workspace called Saba and it don't allow use of scripts. Just HTML and CSS.

When I'm refering to center frame, I'm refering to this. I would like to get a description like this everytime you click on a tab.

View attachment 2048
Can you provide the link to the workspace. I have personally never heard of it, but I am sure they must have some scripting editing
 
Can you provide the link to the workspace. I have personally never heard of it, but I am sure they must have some scripting editing
Either way, you would still need scripting to accomplish what you need. CSS is a for styling and animations, not for adding events like clicking
 

New Threads

Latest posts

Buy us a coffee!

Back
Top Bottom