CSS HTML Class Not Working [closed] - html

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 5 years ago.
Improve this question
for class I was given an HTML file and CSS file to edit. The code contains 2 tables and I am supposed style the one shown below. To do this I made a class called "mytable"
<table class=“mytable”>
<caption>My important data</caption>
<tr><th>Column 1</th><th>Column 2</th></tr>
<tr><td>1,1</td><td>1,2 okay</td></tr>
<tr><td>2,1 real wide</td><td>2,2</td></tr>
<tr><td>test</td><td>works?</td></tr>
<tr><td>another test</td><td>still work?</td></tr>
</table>
This is how I declared the class in my css file. It does not work. What am I doing wrong?
.mytable tr { font-style: italic;}
.mytable td { background-color: green; text-align: center; width: 30% }

Working pen solution of your problem here
change your quotes to " " or ' ' as quotes you are using are not valid in html.
Will suggest to change your editor I thing you are using word. Use notepad or Visual Studio Code
<table class="mytable">
<caption>My important data</caption>
<tr><th>Column 1</th><th>Column 2</th></tr>
<tr><td>1,1</td><td>1,2 okay</td></tr>
<tr><td>2,1 real wide</td><td>2,2</td></tr>
<tr><td>test</td><td>works?</td></tr>
<tr><td>another test</td><td>still work?</td></tr>
</table>
.mytable tr { font-style: italic;}
.mytable td { background-color: green; text-align: center; width: 30% }

Related

Looking for a way to joint containers together in HTML [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 16 days ago.
Improve this question
I'm trying to recreate an album cover into a website and I can't figure out how to line things up like this.
image
I prefer only using HTML but I'm not opposed to CSS : )
I should also mention that I don't really know a ton about HTML, I more just make things for fun, so sorry if I don't understand any questions or certain terms
We can create a table, and then add some styling via CSS:
<style>
td {
border:4px solid red;
padding: 13px;
text-align: center;
text-transform: uppercase;
font-weight: 1000;
font-size: 25px;
font-family: Arial, sans-serif;
}
</style>
<table>
<tr>
<td>Heaven</td>
</tr>
<tr>
<td>Radiation</td>
</tr>
<tr>
<td>Radio</td>
</tr>
<tr>
<td>Television</td>
</tr>
</table>

CANNOT change anythings in css [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 2 years ago.
Improve this question
Why can I not change the color, size or anything by using the project class or project id?? I can only can change something through These CLASS??
.These {
display: flex;
flex-direction: column;
height: 90vh;
align-items: center;
width: 100%;
}
#project {
color: yellow;
font-size: 3rem;
}
<div class="These">
<p clsss="project" id="project">
These are some of my projects
</p>
</div>
Check and make sure your CSS style sheet is properly linked to your HTML.
Your code works for me in codepen.There is a typo, however the ID should still pull it so I would check for a linking issue or post your
There is a typo in your paragraph element. Change clsss to class.
You have missspelled class. You have use clsss instead of class.
Snippet:
<div class="These">
<p class="project" id="project">
These are some of my projects
</p>
</div>

how to avoid design break up in html [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 7 years ago.
Improve this question
This is what I have so far:
body {
padding: none;
background: green;
}
.layoutTable {
width: 100%;
height: 100%;
border: 2px solid black;
position: fixed;
background: red;
margin: 0;
padding: 0;
}
.bodyStyle,
html,
.layoutTable {
margin: 0px;
padding: 0px;
}
<table class="layoutTable">
<tr>
<td>
<!-- japaneseclass Schedule -->
</td>
</tr>
</table>
The output:
I ran this code in IE11 and there is a gap between body and table, I don't know how to remove this, and the design breaks on zoom.
All HTML document by default have a margin surrounding all four corners of it. As desirable as margins are in most cases, sometimes they with your design, such as a header bar that spans the entire page horizontally. In this tutorial I'll show you the two techniques most commonly used to remove the document's margins, so content presses right against the edge of the window.
<body bgcolor="green" style="padding:0;margin:0">
Codepen http://codepen.io/noobskie/pen/avVQQy?editors=110
This seems to remove the gap between your elements all you need to do was add padding:0; & margin:0; to the body tag i'm not sure what you mean when you say the design breaks whenever you zoom though can you explain?
Also it seems redundant to have a separate class for body ie bodystyle(assuming thats what your using that for) when you can just use body as a selector itself
I think you just forgot to attach your bodyStyle class in your CSS to the body tag in your HTML...
<body bgcolor="green" style="padding:none;" class="bodyStyle">
It's always a good idea to do a 'browser reset' as all browsers treat this gap differently. That's why you should add the following css:
* {
margin: 0;
padding: 0;
}

Unable to remove text-decoration with 2nd span tag inside of TD tag [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 7 years ago.
Improve this question
I've been trying for hours to find a way to remove a text decoration within a TD tag. I've used SPAN CLASS to apply underline and a smaller font size to one portion of my text within a tables TD tag. But when I try to remove it with textdecoration: none either via a CSS class or with SPAN STYLE, it does not work. I tried searching and find some questions about nested SPAN tags, but I am not nesting in this case. I am closing the first span tag before opening the new one.
Is there lack of support with using two SPAN tags inside of one element (in this case being the TD?) or is there some other way to achieve this?
JSFiddle: otzfsvy2
WARNING CONTAINS CONTENT NSFW
http://jsfiddle.net/otzfsvy2/
Any help to help me understand why I can't do it this way and what way would work would be much appreciated.
You are missing > here: <td height='40' width='10'
Working code should be:
.playlistArtist {
font-style:italic;
font-size: 10px;
text-decoration:underline;
font-family: Tahoma;
color: Black;
vertical-align: middle;
font-weight: bold;
}
.noDecoration {
text-decoration: none;
}
.playlist {
font-family: Tahoma;
font-size: 14px;
color: Black;
vertical-align: middle;
font-weight: bold;
}
<table class='playlist' width='455' id='queueList' border='1'>
<col width='40'/>
<col width='365'/>
<col width='40'/>
<tr id='plTrTag_0' bgcolor='FFFFFF'>
<td class='playlist' width='40' height='40'>
<img width='40' height='40' src='http://lh6.ggpht.com/2iOdoyv7t1GgYw5-dJz9Z0facGcvQmw7-I85xs8_qjyKqFe8AesES_fJfDD-_Hmm21lJQYcUoT4HyITVjt_W2P8'></img>
</td>
<td height='40' width='10'>
<span class='playlistArtist'>Kid Rock</span>
<br/><span style='text-decoration:none;'> Bawitdabaw</span>
</td>
<td class='playlist' align='right' width='70px' height='40px'>
<span id='plEntryDur0'>[Dur]</span>
</td>
</tr>

Overriding HTML img with CSS [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 6 years ago.
Improve this question
My jpeg is a pixelated obese shell of its former self... Is it possible to actually override html img height/width code with a css stylesheet instead of just streching an already adjusted image? The reason I ask is that a client has me working with godaddy's quick shopping cart (evil). The code it generates changes the size of the image in the html. Godaddy only allows css alterations, which is how I've managed to at least stretch the image back to original size. Unfortunately, it seems the html is applied to the image first despite the img css I've written, and then the css expands the image to nasty pixels. It's possible that, in addition to the height and width specifications in the html, godaddy has actually already converted the image to the smaller size on their server, though their techs deny this and the code would then be redundant. The CSS I'm using is pasted below, as is the unchangeable code that GoDaddy generates.
//FROM CSS
td.imageRow {
padding: 10px 0 5px;
vertical-align: middle;
width:192px;
height:250px;
}
.productTable img {
border: 0 none;
width:192px;
height:250px;
}
.productTable a {
width:192px;
height:250px;
}
//FROM HTML
<tbody>
<tr><td class="imageRow"><a href="/Logo.htm">
<img width="122" height="160" alt="Logo" src="/images/13129490572471789450105.jpeg">
</a></td><td class="noBorder"></td><td class="noBorder"></td></tr>
<tr><td class="titleRow">Logo</td><td></td><td></td></tr>
<tr><td class="priceRow"></td><td></td><td></td></tr>
<tr><td class="spacer"> </td></tr>
You can use the !important override:
.productTable img {
border: 0 none;
width:192px !important;
height:250px!important;
}
See http://jsfiddle.net/GDVXw/ for an example.
Just to illustrate, I've stretched the image a bunch here so you can see more clearly that the overrides works: http://jsfiddle.net/GDVXw/1/.