Solved

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

Posted on 2014-11-10
5
87 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 82

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 82

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 82

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

So you have coded your own WordPress plugin and now you want to allow users to upload images to a folder in the plugin folder rather than the default media location? Follow along and this article will show you how to do just that!
Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

762 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now