Ask your own question, for FREE!
Computer Science 7 Online
OpenStudy (anonymous):

I need help with how to put images in this type of layout http://www.cs.umd.edu/class/fall2012/cmsc122/Projects/P2/example.png how do I make images layout like they are on this webpage

OpenStudy (espex):

One of the easier ways is with a table, what kind of software do you have to use?

OpenStudy (anonymous):

I am using komodo edit. A table is good but I was thinking of using a id and using margins to change where the photo's are place or floats but they are not working

OpenStudy (espex):

What are you getting?

OpenStudy (anonymous):

When I use the float after targeting one image with a id nothing happens

OpenStudy (espex):

Do you have an example of your code?

OpenStudy (anonymous):

here is my code: html <img id="good" src="tim.jpg" alt="Tim Berners-Lee" width="140px" height="140px"/> <img id="great" src="GraceHopper.jpg" alt="Grace Hopper" width="140px" height="140px"/> <img id="person" src="Ada.jpg" alt="Ada Lovelace" width="140px" height="140px"/> <img id="man" src="Babbage.png" alt="Babbage" width="140px" height="140px" align="right"/> css #person{ float:left; I images moves to the left actually but I want it to move to the bottom of the other image

OpenStudy (anonymous):

the css has a } at the end forgot to copy that

OpenStudy (espex):

Shouldn't that be <div id="person"> <img src="Ada.jpg>?

OpenStudy (espex):

Do you not float the div?

OpenStudy (anonymous):

I could try it

OpenStudy (anonymous):

although would that move all the images to the left

OpenStudy (espex):

You have the tag #person that you are trying to float, yet the image is the only id I can see as person. Perhaps you want to put the whole section into a div and then float that, I am not sure exactly what the big picture is that you are trying to accomplish..

OpenStudy (anonymous):

i tried it and something weird happened i got another border when i didnt specify that and all the images are inside it here is the code <div class="move"> <img src="tim.jpg" alt="Tim Berners-Lee" width="140px" height="140px"/> <img src="GraceHopper.jpg" alt="Grace Hopper" width="140px" height="140px"/> <img src="Ada.jpg" alt="Ada Lovelace" width="140px" height="140px"/> <img src="Babbage.png" alt="Babbage" width="140px" height="140px" align="right"/> </div> .move{ float:left; }

OpenStudy (anonymous):

i am just trying to replicate that webpage so I need to put the images exactly like they are on that page.

OpenStudy (espex):

And have you tried just using a bit of relative positioning to set the images where you need them?

OpenStudy (espex):

That may interfere with the text if someone resized the window though.

OpenStudy (anonymous):

how do I do that, I cant figure it out, would using a table be easier

OpenStudy (espex):

Using a table would be easier because you would define them and put your images in, but your class might want you to use css specifically.

OpenStudy (espex):

You could try positioning, here is a simple example. http://www.html.net/tutorials/css/lesson14.php

OpenStudy (anonymous):

I think I can use tables because we haven't covered positioning yet. If that doesnt work then I will do positioning.

OpenStudy (espex):

Well good luck with the table, should you try positioning then this w3 school link should help you. http://www.w3schools.com/cssref/pr_class_position.asp The "try it" link gives you a taste of where it will land on the page.

OpenStudy (anonymous):

thanks, I think the table worked, I will just need to fix the spacing now and put text underneath

OpenStudy (anonymous):

can I do that without using css

OpenStudy (espex):

What, put text underneath?

OpenStudy (anonymous):

like in the example, maybe I could use a p tag in inside the td tag

OpenStudy (espex):

Sure, just add it in the same cell as the image and include a <br> or add another row beneath the image and put the text inside that.

OpenStudy (anonymous):

It worked, although the text is not centered so maybe I will need to use margin after all but thanks for all your help

OpenStudy (espex):

Any time, as for the centering, you can use the align=center tag to place it in the center of the cell.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!