I have one modal on my HTML so I created the following CSS. I gave it an id rather than a class as there is only ever one of these used on a page.
#modal {
position: fixed;
z-index: 1050;
top: 0;
left: 0;
bottom: 0;
right: 0;
width: 900px;
height: 300px;
margin: auto;
}
- On my page "subject" I want the modal to have a width of 900px and height of 300px. I assume the way to handle this is with an id of subject and 900/300 for width and height in the CSS.
- On my page "city" I want the modal to have a width of 800px and height of 300px. I assume the way to handle this is with an id of subject and 800/300 for width and height in the CSS.
What's the best way for me to handle the CSS style for this? I know one solution would be to make modal a class and then use the id for the different sizes. But making something that only appears once on a page as a class does not seem right.
Is there some way in CSS that I can have an id of "modal-subject" and "modal-city" and then use some CSS selector to pick out the "modal" and "-city" so the CSS can handle this ?
Update:
It looks like What does the selector [class^="span"] do? might be the solution for this.