HTML/web

Advertisement


Question
QUESTION: I copied an image from a website to my own (just for fun, i'm learning) but it is smaller on my site and I changed my height and width but no matter how large the numbers are the image stays the same size. I copied a black and white grid (located in the middle of the page of the other website). Actually most of the images are larger on that site than on mine. The site I coped from is http://news.distractify.com/culture/mind-blowing-optical-illusions/?v=1

ANSWER: Hi Al,

Providing the code you've used would be helpful, so I can help diagnose what you've done wrong.

I would suggest resizing the images in Photoshop instead of the web browser, and then displaying the correctly resized image in your browser.  However, here is how you'd resize the image tp 300x300:

<img src="http://www.distractify.netdna-cdn.com/wp-content/uploads//2014/05/523458_4766699 width="300" height="300">

or

<img src="http://www.distractify.netdna-cdn.com/wp-content/uploads//2014/05/523458_4766699 style="height:300px;width:300px;">

---------- FOLLOW-UP ----------

QUESTION: Thanks it worked. Another question, we have a site that looks good on medium to large computer screens but looks bad on small desktop screens. The main page is a 3 col. layout but it turns into a 1 col. on a small desktop screen and it has lots of space on either side - enough for at least another col. Why does that happen and how to fix it?

Answer
Without seeing the code, my guess is because it is fixed sizes.  If your site is say 1000px wide, and you're looking at it on a screen that is 700px wide, you won't be able to see it all.

Generally, you want to do one of two things:

1. Create a fluid layout - using percentage for sizing elements on the page so they resize to fit the size of the screen they're viewed on.

2. Create a separate stylesheet for each screen size/device type.

HTML

All Answers


Answers by Expert:


Ask Experts

Volunteer


Dan Stephenson

Expertise

I am a professional Web Designer & Developer. I work with HTML, XHTML and CSS every day, and would be glad to help with your problems, and answer your questions.

Experience


Experience in the area I have been a web designer/developer since 1997. I started developing websites with HTML 3.2 and using tables for layout. In 2006 I received my degree in Computational Media, and now work full time as a Webmaster and Interactive Media Author, as well as teaching continuing education courses on HTML, CSS and ActionScripting at my local college. Currently I design with XHTML and CSS - no tables and much cleaner and more accessible code and allows the designer more freedom and flexibility than tables.

Education/Credentials
New Media Production & Design Degree - SAIT Polytechnic

©2016 About.com. All rights reserved.