Solved

CSS How do I make my css file make any image in a table a certain size?

Posted on 2014-11-10
5
91 Views
Last Modified: 2014-11-10
CSS How do I make my css file make any image in a table a certain size?
0
Comment
Question by:padmasambhava
  • 3
  • 2
5 Comments
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 40433831
That is normally done in the image tag, not in CSS.  To do it in CSS, you would have to give each image a unique id so you could apply the specific CSS to it.  Another way in a table with fixed cell sizes is to set the width to a percentage instead of pixels.  100% will fill the cell.
0
 

Author Comment

by:padmasambhava
ID: 40433847
I cannot put it inline. Every attempt to add a width has resulted in no change.
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 40433884
Then you need to give us a link to check out your page to see what is causing it.
0
 

Author Comment

by:padmasambhava
ID: 40433903
0
 
LVL 83

Accepted Solution

by:
Dave Baldwin earned 500 total points
ID: 40433952
This is the image tag for that page:

<img id="pic" src="art/titmouse_299x375.jpg">

I realize that you are generating all that from a PHP page but you still need to set a width or a height in the image tag so the large images don't 'blow up' the page.  If you set a fixed height like 375px, then the browser will scale the image to that size.  Something like this:

<img id="pic" src="art/titmouse_299x375.jpg" height="375px">
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
jQuery Sticky Menu 24 36
Responsive Font Size 6 30
Add a Location and Color Price based on select box selected option 17 52
I'm a Human captcha checkbox 13 23
Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question