Noobie help please, HTML page does not apply the CSS |
Noobie help please, HTML page does not apply the CSS |
TW Allen |
Apr 14 2021, 01:55 PM
Post
#21
|
Member Group: Members Posts: 42 Joined: 12-April 21 Member No.: 27,890 |
I am having difficulty will table borders. In the page: allendesigns.com/projects.html, I can get the outside border, but I cannot get the borders between the cells. What do I need to do? Thank you In CSS the TABLE, TH and TD element borders are styled separately, so you need CSS rules for all of them. Soooo....if I have some tables with lines (borders) and some without, I have to create a class (or classes), right? |
pandy |
Apr 14 2021, 02:13 PM
Post
#22
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,730 Joined: 9-August 06 Member No.: 6 |
Classes, IDs... If there isn't already something in the HTML you can use to create a selector.
|
TW Allen |
Apr 14 2021, 03:33 PM
Post
#23
|
Member Group: Members Posts: 42 Joined: 12-April 21 Member No.: 27,890 |
Classes, IDs... If there isn't already something in the HTML you can use to create a selector. I've learned (finally) that if it has to do with formatting and I use HTML, I'll get a validation error. So, if I have tables that are formatted differently, I need unique classes for each one. I'm getting it. Slowly but surely. I got that (lines around cells) done. See allendesigns.com/projects.html. It doesn't look the same on my phone as it does on my monitor. I'm guessing that might have something to do with resolution, number of pixels, etc. Maybe not. Still having trouble with Chome on my desktop. |
TW Allen |
Apr 14 2021, 03:34 PM
Post
#24
|
Member Group: Members Posts: 42 Joined: 12-April 21 Member No.: 27,890 |
Classes, IDs... If there isn't already something in the HTML you can use to create a selector. I've learned (finally) that if it has to do with formatting and I use HTML, I'll get a validation error. So, if I have tables that are formatted differently, I need unique classes for each one. I'm getting it. Slowly but surely. I got that (lines around cells) done. See allendesigns.com/projects.html. It doesn't look the same on my phone as it does on my monitor. I'm guessing that might have something to do with resolution, number of pixels, etc. Maybe not. Still having trouble with Chome on my desktop. |
pandy |
Apr 14 2021, 03:43 PM
Post
#25
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,730 Joined: 9-August 06 Member No.: 6 |
Well, you need *something* that distinguishes the table you want to target from the others. If there's nothing else, class or ID it is.
Say you have some Ps (a table would be odd and I can't think of another example right now) in a sidebar where you also have other things, links and images maybe. You have probably wrapped everything in the sidebar in a DIV to be able to style it uniformly. Maybe the HTML looks like this (simplified). CODE <div id="sidebar"> ... links... <p> Blah blah blah</p> ... image... <p> Blah blah blah</p> <p> Blah blah blah</p> </sidebar> Now you want the Ps in the sidebar to be red, but only those. You don't need to class them, because you can use the ID the DIV already has. CODE #sidebar p { color: red } Without the DIV, yes you would need to use class. |
TW Allen |
Apr 14 2021, 04:19 PM
Post
#26
|
Member Group: Members Posts: 42 Joined: 12-April 21 Member No.: 27,890 |
Thank you!
|
Lo-Fi Version | Time is now: 24th April 2024 - 05:56 AM |