The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

2 Pages V < 1 2  
Reply to this topicStart new topic
> Noobie help please, HTML page does not apply the CSS
TW Allen
post Apr 14 2021, 01:55 PM
Post #21


Member
***

Group: Members
Posts: 42
Joined: 12-April 21
Member No.: 27,890



QUOTE(Christian J @ Apr 14 2021, 01:42 PM) *

QUOTE(TW Allen @ Apr 14 2021, 08:32 PM) *

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?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Apr 14 2021, 02:13 PM
Post #22


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,716
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.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
TW Allen
post Apr 14 2021, 03:33 PM
Post #23


Member
***

Group: Members
Posts: 42
Joined: 12-April 21
Member No.: 27,890



QUOTE(pandy @ Apr 14 2021, 02:13 PM) *

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.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
TW Allen
post Apr 14 2021, 03:34 PM
Post #24


Member
***

Group: Members
Posts: 42
Joined: 12-April 21
Member No.: 27,890



QUOTE(pandy @ Apr 14 2021, 02:13 PM) *

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.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Apr 14 2021, 03:43 PM
Post #25


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,716
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.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
TW Allen
post Apr 14 2021, 04:19 PM
Post #26


Member
***

Group: Members
Posts: 42
Joined: 12-April 21
Member No.: 27,890



Thank you!
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

2 Pages V < 1 2
Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 19th March 2024 - 05:05 AM