Here is an image of my code in a browser window that shows the images laying out horizontally instead of vertically.
Is this simply the product of my browser width, and the size I made my images?
image of horizontal alignment
<div id="images">
<h3>Here is some design work that I have done</h3>
<img id="img1" src="photos/bees_wax_final_logo.jpg" width="200px" height="300px" alt="beeswax" />
<img id="img2" src="photos/before-and-after.jpg" height="200px" width="200px" alt="beforeandafter" />
<img id="img3" src="photos/Brush-work-buildings.jpg" alt="brushwork" height="200px" width="200px" />
<img id="img4" src="photos/Cosmic-woman.jpg" alt="cosmic" height="200px" width="200px" />
<img id="img5" src="photos/cosmo_elephant.jpg" alt="cosmo" height="200px" width="200px" />
<img id="img6" src="photos/Dispersion_window.jpg" alt="dispersion" height="200px" width="200px" />
<img id="img7" src="photos/Free_dogs_drawing.jpg" alt="freedogs" height:="200px" width="200px" />
<img id="img8" src="photos/Graphic-vector-art-logo-copy.jpg" alt="vectorart" height="200px" width="200px" />
<img id="img10" src="photos/I_am_coming_for_you.jpg" alt="shark" height="200px" width="200px" />
<img id="img10" src="photos/keener_raw_honey_logo.jpg" alt="rawhoney" height="200px" width="200px" />
<img id="img11" src="photos/Magazine_cover.jpg" alt="magazinecover" height="200px" width="200px" />
<img id="img12" src="photos/moon_man_background.jpg" alt="moonman" height="200px" width="200px" />
<img id="img13" src="photos/Nature_Double_Exposure.jpg" alt="nature" height="200px" width="200px" />
<img id="img14" src="photos/purple_water.jpg" alt="purplewater" height="200px" width="200px" />
<img id="img15" src="photos/Surrealism-style.jpg" alt="surrealism" height="200px" width="200px" />
<img id="img16" src="photos/Surrealism.jpg" alt="surrealsim2" height="200px" width="200px" />
<img id="img17" src="photos/the_greener_lawn.jpg" alt="greenlawn" height="200px" width="200px" />
<img id="img18" src="photos/Window-correction.jpg" alt="windowcorrection" height="200px" width="200px" />
</div>
Okay, quickest solutions would be to set a display: block on all the images to remove any floating around them using css. So they will stack vertically.
#images img{
display: block;
}
<div id="images">
<h3>Here is some design work that I have done</h3>
<img id="img1" src="photos/bees_wax_final_logo.jpg" width="200px" height="300px" alt="beeswax"/>
<img id="img2" src="photos/before-and-after.jpg" height="200px" width="200px" alt="beforeandafter"/>
<img id="img3" src="photos/Brush-work-buildings.jpg" alt="brushwork" height="200px" width="200px"/>
<img id="img4" src="photos/Cosmic-woman.jpg" alt="cosmic" height="200px" width="200px"/>
<img id="img5" src="photos/cosmo_elephant.jpg" alt="cosmo" height="200px" width="200px"/>
<img id="img6" src="photos/Dispersion_window.jpg" alt="dispersion" height="200px" width="200px"/>
<img id="img7" src="photos/Free_dogs_drawing.jpg" alt="freedogs" height:="200px" width="200px"/>
<img id="img8" src="photos/Graphic-vector-art-logo-copy.jpg" alt="vectorart" height="200px" width="200px"/>
<img id="img10" src="photos/I_am_coming_for_you.jpg" alt="shark" height="200px" width="200px"/>
<img id="img10" src="photos/keener_raw_honey_logo.jpg" alt="rawhoney" height="200px" width="200px"/>
<img id="img11" src="photos/Magazine_cover.jpg" alt="magazinecover" height="200px" width="200px"/>
<img id="img12" src="photos/moon_man_background.jpg" alt="moonman" height="200px" width="200px"/>
<img id="img13" src="photos/Nature_Double_Exposure.jpg" alt="nature" height="200px" width="200px"/>
<img id="img14" src="photos/purple_water.jpg" alt="purplewater" height="200px" width="200px"/>
<img id="img15" src="photos/Surrealism-style.jpg" alt="surrealism" height="200px" width="200px"/>
<img id="img16" src="photos/Surrealism.jpg" alt="surrealsim2" height="200px" width="200px"/>
<img id="img17" src="photos/the_greener_lawn.jpg" alt="greenlawn" height="200px" width="200px"/>
<img id="img18" src="photos/Window-correction.jpg" alt="windowcorrection" height="200px" width="200px"/>
</div>
If you want to show them vertically you can put a <br> after every image. Then you can center the images in your CSS file so that it looks cleaner. There are other ways of doing this. This might be one of the easiest.
<div id="images">
<h3>Here is some design work that I have done</h3>
<img id="img1" src="photos/bees_wax_final_logo.jpg" width="200px" height="300px" alt="beeswax" />
<br>
<img id="img2" src="photos/before-and-after.jpg" height="200px" width="200px" alt="beforeandafter" />
<br>
<img id="img3" src="photos/Brush-work-buildings.jpg" alt="brushwork" height="200px" width="200px" />
Related
so i have a table and i want the buttons side by side instead of stacked
Css or HTML is fine but not js sorry if the question isnt very clear im still new to this :/
i tried
display: flex;
align-items: center;
justify-content: center;
but that just does this
ive included the CSS and html code snippett bellow thanks to everyone who can help i kept the alts instead of the actual image because this is for my photography website
#charset "UTF-8";
button{
display:inline-block;
padding:0.5em 3em;
border:0.16em solid #FFFFFF;
margin:0 0.3em 0.3em 0;
box-sizing: border-box;
text-decoration:none;
text-transform:uppercase;
font-family:'Roboto',sans-serif;
font-weight:400;
color:#FFFFFF;
text-align:center;
transition: all 0.15s;
}
button:hover{
color:#DDDDDD;
border-color:#DDDDDD;
}
button:active{
color:#BBBBBB;
border-color:#BBBBBB;
}
#media all and (max-width:30em){
button{
display:block;
margin:0.4em auto;
}
}
<div style="text-align:center">
<button id="wildlife">EG </button><br>
<button id="landscape">EG </button><br>
<button id="ocean">EG </button>
</div>
<div class="wildlife">
<img src="Images/animals/DSC04758.jpg" eight="150" width="200" alt="rocks" />
<img src="Images/animals/bird.png" eight="150" width="200" alt="rocks" />
<img src="Images/animals/birds1.png" eight="150" width="200" alt="rocks" />
<img src="Images/animals/birds2.png" eight="150" width="200" alt="rocks" />
<img src="Images/animals/birds3.png" eight="150" width="200" alt="rocks" />
<img src="Images/animals/birds4.png" eight="150" width="200" alt="rocks" />
</div>
<div class="landscape">
<img src="" height="150" width="200" alt="rocks" />
<img src="" height="150" width="200" alt="rocks" />
<img src="" height="150" width="200" alt="rocks" />
<img src="" height="150" width="200" alt="rocks" />
<img src="" height="150" width="200" alt="rocks" />
<img src="" height="150" width="200" alt="rocks" />
</div>
<div class="ocean">
<img src="" height="150" width="200" alt="rocks" />
<img src="" height="150" width="200" alt="rocks" />
<img src="" height="150" width="200" alt="rocks" />
<img src="" height="150" width="200" alt="rocks" />
<img src="" height="150" width="200" alt="rocks" />
<img src="" height="150" width="200" alt="rocks" />
</div>
<font face="sans-serif" color="#017bf5" size="5" align="center">
<h1>### </h1>
</font>
<font face="sans-serif" color="#444" size="3" align="center">
<h1>###</h1>
</font>
</body>
In Your HTML Code, you used <br> tag after each button. Which pushes your button to the next line.
Solution: Remove <br> tags after button elements.
A div box around the buttons with display: flex; and flex-direction: row; Should work
First of all I'm new and I need a little help to fix this basic HTML code ,
the code is :
<head>
<title>
Shared column border
</title>
<style type="text/css">
/*<![CDATA[*/
<!--
#left { width: 5px; float: left;
border-right: 8px solid #444 }
#right { margin-left: 500px;
border-left: 8px solid #0b9cef }
/*]]>*/
</style>
</head>
<body>
<p>
<img class="alignnone size-thumbnail wp-image-5242" src=
"https://i.postimg.cc/SNJHq645/1398913.png" alt="" width="20"
height="20" /> <big>Secure Client Area- Portal</big>
</p>
<p>
<img class="alignnone size-thumbnail wp-image-5242" src=
"https://i.postimg.cc/SNJHq645/1398913.png" alt="" width="20"
height="20" /> <big>Urgent Delivery Available</big>
</p>
<p>
<img class="alignnone size-thumbnail wp-image-5242" src=
"https://i.postimg.cc/SNJHq645/1398913.png" alt="" width="20"
height="20" /> <big>100% Manual Photo Editing</big>
</p>
<p>
<img class="alignnone size-thumbnail wp-image-5242" src=
"https://i.postimg.cc/SNJHq645/1398913.png" alt="" width="20"
height="20" /> <big>SSL Secured Image Transfer</big>
</p>
<p>
<img class="alignnone size-thumbnail wp-image-5242" src=
"https://i.postimg.cc/SNJHq645/1398913.png" alt="" width="20"
height="20" /> <big>Monthly Payment Plan</big>
</p>
<p>
<img class="alignnone size-thumbnail wp-image-5242" src=
"https://i.postimg.cc/SNJHq645/1398913.png" alt="" width="20"
height="20" /> <big>Variety of Payment Methods</big>
</p>
<div id="right">
<p>
<img class="alignnone size-thumbnail wp-image-5242" src=
"https://i.postimg.cc/SNJHq645/1398913.png" alt="" width=
"20" height="20" /> <big>100% Satisfaction Gauranteed</big>
</p>
<p>
<img class="alignnone size-thumbnail wp-image-5242" src=
"https://i.postimg.cc/SNJHq645/1398913.png" alt="" width=
"20" height="20" /> <big>Money-Back Gaurantee</big>
</p>
<p>
<img class="alignnone size-thumbnail wp-image-5242" src=
"https://i.postimg.cc/SNJHq645/1398913.png" alt="" width=
"20" height="20" /> <big>Right Price & Best
Quality</big>
</p>
<p>
<img class="alignnone size-thumbnail wp-image-5242" src=
"https://i.postimg.cc/SNJHq645/1398913.png" alt="" width=
"20" height="20" /> <big>12hr Quick Turnaround Time</big>
</p>
<p>
<img class="alignnone size-thumbnail wp-image-5242" src=
"https://i.postimg.cc/SNJHq645/1398913.png" alt="" width=
"20" height="20" /> <big>Volume Discount Up to 20%</big>
</p>
<p>
<img class="alignnone size-thumbnail wp-image-5242" src=
"https://i.postimg.cc/SNJHq645/1398913.png" alt="" width=
"20" height="20" /> <big>365 Days Operation Enabled</big>
</p>
</div>
</body>
</html>
I want to 2nd column in the same position as the 1st column is in.
+
I want some space between the blue separator / divider & 2nd column
Can anyone help me to fix this or Can anyone teach me how to do this ?
as I said I'm new so looking forward for some guidance !
First of all you are not using the styling rule #left that has float:left anywhwere. So no floating is happening to the p elements.
Then you are wrapping your second column with a <div id="right"> and the #right styling ruke has no float in it. Thats why the <p> elements are displaying as blocks and not aligning next to each other. Maybe wrap the first column with <div id="left"> and use the following for your #left css rule :
#left {
float: left;
border-right: 8px solid #444;
padding-right: 25px // added some padding distance between the content and right border
}
Second point, for
I want some space between the blue separator / divider & 2nd column
you can use padding (refer to this article to see the difference between padding and margin : Margin vs Padding.
Here's your updated code to provide what you need (note that I added 25px padding ditance beween the blue border and the content, and 25px distance between the left colulmn and the right one.)
<head>
<title>
Shared column border
</title>
<style type="text/css">
/*<![CDATA[*/
<!--
#left {
float: left;
border-right: 8px solid #444;
padding-right: 25px
}
#right {
border-left: 8px solid #0b9cef;
float: left;
padding-left: 25px;
margin-left: 25px;
}
/*]]>*/
</style>
</head>
<body>
<div id="left">
<p>
<img class="alignnone size-thumbnail wp-image-5242" src="https://i.postimg.cc/SNJHq645/1398913.png" alt="" width="20"
height="20"/> <big>Secure Client Area- Portal</big>
</p>
<p>
<img class="alignnone size-thumbnail wp-image-5242" src=
"https://i.postimg.cc/SNJHq645/1398913.png" alt="" width="20"
height="20"/> <big>Urgent Delivery Available</big>
</p>
<p>
<img class="alignnone size-thumbnail wp-image-5242" src=
"https://i.postimg.cc/SNJHq645/1398913.png" alt="" width="20"
height="20"/> <big>100% Manual Photo Editing</big>
</p>
<p>
<img class="alignnone size-thumbnail wp-image-5242" src=
"https://i.postimg.cc/SNJHq645/1398913.png" alt="" width="20"
height="20"/> <big>SSL Secured Image Transfer</big>
</p>
<p>
<img class="alignnone size-thumbnail wp-image-5242" src=
"https://i.postimg.cc/SNJHq645/1398913.png" alt="" width="20"
height="20"/> <big>Monthly Payment Plan</big>
</p>
<p>
<img class="alignnone size-thumbnail wp-image-5242" src=
"https://i.postimg.cc/SNJHq645/1398913.png" alt="" width="20"
height="20"/> <big>Variety of Payment Methods</big>
</p>
</div>
<div id="right">
<p>
<img class="alignnone size-thumbnail wp-image-5242" src=
"https://i.postimg.cc/SNJHq645/1398913.png" alt="" width=
"20" height="20"/> <big>100% Satisfaction Gauranteed</big>
</p>
<p>
<img class="alignnone size-thumbnail wp-image-5242" src=
"https://i.postimg.cc/SNJHq645/1398913.png" alt="" width=
"20" height="20"/> <big>Money-Back Gaurantee</big>
</p>
<p>
<img class="alignnone size-thumbnail wp-image-5242" src=
"https://i.postimg.cc/SNJHq645/1398913.png" alt="" width=
"20" height="20"/> <big>Right Price & Best
Quality</big>
</p>
<p>
<img class="alignnone size-thumbnail wp-image-5242" src=
"https://i.postimg.cc/SNJHq645/1398913.png" alt="" width=
"20" height="20"/> <big>12hr Quick Turnaround Time</big>
</p>
<p>
<img class="alignnone size-thumbnail wp-image-5242" src=
"https://i.postimg.cc/SNJHq645/1398913.png" alt="" width=
"20" height="20"/> <big>Volume Discount Up to 20%</big>
</p>
<p>
<img class="alignnone size-thumbnail wp-image-5242" src=
"https://i.postimg.cc/SNJHq645/1398913.png" alt="" width=
"20" height="20"/> <big>365 Days Operation Enabled</big>
</p>
</div>
</body>
To adjust that blue line on the left you will need to add padding to the left ( I made it 10px but you can adjust it)
And set the width of the left to look good for you.
Here is the code
<body>
<title>
Shared column border
</title>
<style type="text/css">
/*<![CDATA[*/
<!--
#left {
width: 300px;
float: left;
border-right: 8px solid #444 }
#right {
margin-left: 500px;
border-left: 8px solid #0b9cef;
padding-left: 10px;
}
/*]]>*/
</style>
<div id="left">
<p>
<img class="alignnone size-thumbnail wp-image-5242" src="https://i.postimg.cc/SNJHq645/1398913.png" alt="" width="20" height="20"> <big>Secure Client Area- Portal</big>
</p>
<p>
<img class="alignnone size-thumbnail wp-image-5242" src="https://i.postimg.cc/SNJHq645/1398913.png" alt="" width="20" height="20"> <big>Urgent Delivery Available</big>
</p>
<p>
<img class="alignnone size-thumbnail wp-image-5242" src="https://i.postimg.cc/SNJHq645/1398913.png" alt="" width="20" height="20"> <big>100% Manual Photo Editing</big>
</p>
<p>
<img class="alignnone size-thumbnail wp-image-5242" src="https://i.postimg.cc/SNJHq645/1398913.png" alt="" width="20" height="20"> <big>SSL Secured Image Transfer</big>
</p>
<p>
<img class="alignnone size-thumbnail wp-image-5242" src="https://i.postimg.cc/SNJHq645/1398913.png" alt="" width="20" height="20"> <big>Monthly Payment Plan</big>
</p>
<p>
<img class="alignnone size-thumbnail wp-image-5242" src="https://i.postimg.cc/SNJHq645/1398913.png" alt="" width="20" height="20"> <big>Variety of Payment Methods</big>
</p>
</div>
<div id="right">
<p>
<img class="alignnone size-thumbnail wp-image-5242" src="https://i.postimg.cc/SNJHq645/1398913.png" alt="" width="20" height="20"> <big>100% Satisfaction Gauranteed</big>
</p>
<p>
<img class="alignnone size-thumbnail wp-image-5242" src="https://i.postimg.cc/SNJHq645/1398913.png" alt="" width="20" height="20"> <big>Money-Back Gaurantee</big>
</p>
<p>
<img class="alignnone size-thumbnail wp-image-5242" src="https://i.postimg.cc/SNJHq645/1398913.png" alt="" width="20" height="20"> <big>Right Price & Best
Quality</big>
</p>
<p>
<img class="alignnone size-thumbnail wp-image-5242" src="https://i.postimg.cc/SNJHq645/1398913.png" alt="" width="20" height="20"> <big>12hr Quick Turnaround Time</big>
</p>
<p>
<img class="alignnone size-thumbnail wp-image-5242" src="https://i.postimg.cc/SNJHq645/1398913.png" alt="" width="20" height="20"> <big>Volume Discount Up to 20%</big>
</p>
<p>
<img class="alignnone size-thumbnail wp-image-5242" src="https://i.postimg.cc/SNJHq645/1398913.png" alt="" width="20" height="20"> <big>365 Days Operation Enabled</big>
</p>
</div>
</body>
I have a screenshot as shown below which I am trying to replicate in html/css:
At this moment, I am able to get everything in fiddle with green and orange arrows not properly aligned.
The CSS codes which I have used in order align arrows and desktop in a straight line are:
.tvs
{
display: flex;
justify-content: space-between;
align-items: center;
padding: 1rem;
}
Problem Statement:
I am wondering what changes I should make in the fiddle so that I am able to align green and orange arrows in a straight line in between the desktops.
You can wrap them in one div element and use text-align: center on that div.
.tvs {
display: flex;
justify-content: space-between;
align-items: center;
padding: 1rem;
}
.arrows-element {
text-align: center;
}
<div class="tvs">
<div class="arrows">
<img src="https://thebettersoftwarecompany.com/wp-content/uploads/2018/05/End-Arrows-left.png" alt="" width="49" height="62" class="aligncenter size-full wp-image-8105" />
</div>
<div class="tv">
<img src="https://thebettersoftwarecompany.com/wp-content/uploads/2018/05/Tv-Screen-2.png" alt="" width="177" height="129" class="aligncenter size-full wp-image-8081" />
</div>
<div class="arrows-element">
<div class="green-arrow">
<img src="https://thebettersoftwarecompany.com/wp-content/uploads/2018/05/green-arrow.png" alt="" width="49" height="24" class="aligncenter size-full wp-image-8109">
</div>
<div class="orange-arrow">
<img src="https://thebettersoftwarecompany.com/wp-content/uploads/2018/05/orange-arrow-v1.png" alt="" width="126" height="24" class="aligncenter size-full wp-image-8114" />
</div>
</div>
<div class="tv">
<img src="https://thebettersoftwarecompany.com/wp-content/uploads/2018/05/Tv-Screen-2.png" alt="" width="177" height="129" class="aligncenter size-full wp-image-8081" />
</div>
<div class="arrows-element">
<div class="green-arrow">
<img src="https://thebettersoftwarecompany.com/wp-content/uploads/2018/05/green-arrow.png" alt="" width="49" height="24" class="aligncenter size-full wp-image-8109">
</div>
<div class="orange-arrow">
<img src="https://thebettersoftwarecompany.com/wp-content/uploads/2018/05/orange-arrow-v1.png" alt="" width="126" height="24" class="aligncenter size-full wp-image-8114" />
</div>
</div>
<div class="tv">
<img src="https://thebettersoftwarecompany.com/wp-content/uploads/2018/05/Tv-Screen-2.png" alt="" width="177" height="129" class="aligncenter size-full wp-image-8081" />
</div>
<div class="arrows-element">
<div class="green-arrow">
<img src="https://thebettersoftwarecompany.com/wp-content/uploads/2018/05/green-arrow.png" alt="" width="49" height="24" class="aligncenter size-full wp-image-8109">
</div>
<div class="orange-arrow">
<img src="https://thebettersoftwarecompany.com/wp-content/uploads/2018/05/orange-arrow-v1.png" alt="" width="126" height="24" class="aligncenter size-full wp-image-8114" />
</div>
</div>
<div class="tv">
<img src="https://thebettersoftwarecompany.com/wp-content/uploads/2018/05/Tv-Screen-2.png" alt="" width="177" height="129" class="aligncenter size-full wp-image-8081" />
</div>
<div class="arrows">
<img src="https://thebettersoftwarecompany.com/wp-content/uploads/2018/05/End-Arrows-right.png" alt="" width="49" height="62" class="aligncenter size-full wp-image-8105" />
</div>
</div>
I want to make a navigation bar, with each item having its own image with the name of the item written on top of that. So there should be a few images in a row, and each one has some text written on it. This is the row of images I got:
<div class="navigation" align="center">
<img src="images/bn_blue.png" width="120" height="70" alt="" />
<img src="images/bn_blue.png" width="120" height="70" alt="" />
<img src="images/bn_blue.png" width="120" height="70" alt="" />
<img src="images/bn_blue.png" width="120" height="70" alt="" />
<img src="images/bn_blue.png" width="120" height="70" alt="" />
<img src="images/bn_blue.png" width="120" height="70" alt="" />
</div>
<div class="navigation" align="center">
<ul><li><div style="background-image:url(images/bn_blue.png);width:120px;height:70px">xyz</div></li>
<li><div style="background-image:url(images/bn_blue.png);width:120px;height:70px">xyz</div></li>
<li><div style="background-image:url(images/bn_blue.png);width:120px;height:70px">xyz</div></li>
<li><div style="background-image:url(images/bn_blue.png);width:120px;height:70px">xyz</div></li>
<li><div style="background-image:url(images/bn_blue.png);width:120px;height:70px">xyz</div><li>
</ul>
</div>
<style>
li
{
display:inline-block;
}
</style>
Give each a href a class ie .home_bg etc.
Then in css add a
.home_bg {
background-image: url(/example/example.png)
}
do this for each image if they are different. Then in the html remove img tags
I have had a good start at geting my codeded table turned over from a table to Div setup but some where in this part right here it seems to be having a problem. This is what the site should look like: http://db.tt/YeUZiiBy.
Here is the code and CSS Link: http://jsfiddle.net/8WKR9/1/.
Here is my HTML `
<div id="container">
<article>
<div class="item">
<img src="4-cute-cats.jpg" class="centerImage" width="300" height="300"
/>
<p class="centerText">They hunt in packs.</p>
</div>
<div class="item">
<img src="cat_sniping.jpg" class="centerImage" width="256" height="192"
/>
<p class="centerText">Sniper Cat</p>
</a>
</div>
<div class="item">
<img src="LOL1.jpg" class="centerImage" width="300" height="298" />
<p class="centerText">Sneaking Cat</p>
</div>
<div class="item">
<img src="hammercat.jpg" class="centerImage" width="300" height="163"
/>
<p class="centerText">80s Cat</p>
</div>
</article>
<article>
<div class="item">
<img src="kittytrap.jpg" class="centerImage" width="200" height=492 />
<p class="centerText">It's a trap!</p>
</div>
<div class="item">
<img src="chop-cats.jpg" class="centerImage" width="300" height="140"
/>
<p class="centerText">They can strip a car to the frame in under 2:00 minutes.</p>
</div>
<div class="item">
<img src="smartkat.jpg" class="centerImage" width="200" height="338" />
<p class="centerText">Intelligent cat.</p>
</a>
</div>
<div class="item">
<img src="narniacat.jpg" class="centerImage" width="200" height="337"
/>
<p class="centerText">Once a cat of Narnia always a cat of Narnia.</p>
</div>
</article>
<article>
<div class="item">
<img src="lolcats3.jpg" class="centerImage" width="300" height="108" />
<p class="centerText">Tired cat.</p>
</div>
<div class="item">
<img src="lol_cats_1.jpg" class="centerImage" width="300" height="142"
/>
<p class="centerText">Gollum Cat.</p>
</div>
<div class="item">
<img src="Magical-Kitty.png" class="centerImage" width="300" height="180"
/>
<p class="centerText">Super Cat.</p>
</div>
<div class="item">
<img src="sad-kitty.jpg" class="centerImage" width="300" height="188"
/>
<p class="centerText">Sad Kitty.</p>
</div>
</article>
<article>
<div class="item">
<img src="cat-in-your-wallpaper.jpg" class="centerImage" width="300" height="200"
/>
<p class="centerText">Wallpaper cat.</div>
<div class="item">
<img src="thinking-cat.jpg" class="centerImage" width="300" height="475"
/>
<p class="centerText">Thinking cat.</p>
</div>
<div class="item">
<img src="http://3.bp.blogspot.com/_znuneBeHigk/TSOOr5DuoQI/AAAAAAAABFY/-Rpe8S1uRo8/s1600/000.jpg&w=823&h=618&ei=_A4VUfP7L4Gy2QXJ-oHIDQ&zoom=1&ved=1t:3588,r:79,s:0,i:354&iact=rc&dur=2621&sig=108293906633680688065&page=3&tbnh=172&tbnw=231&start=67&ndsp=38&tx=64&ty=72"
class="centerImage" width="300" height="225" />
<p class="centerText">Gamer Kitty.</p>
</div>
<div class="item">
<img src="http://www.dumpaday.com/wp-content/uploads/2013/01/funny-lol-cats-playing-with-toilet-paper1.jpg"
class="centerImage" width="300" height="504" />
<p class="centerText">Couch cat.</p>
</div>
</article>
</article>
<article>
<div class="item"> More Kitties
</div>
</article>
</div>`
I think you had the right idea with the mark up but needed some work on the CSS side of things. The key is to clear your floats or else it the item will go to the next available place. I suggest doing a bit more reading on floating and how they effect block elements and the parent element.
I've done a quick 'bare bones' example for you that you should be able to adapt.
http://jsfiddle.net/ZbfXU/2/
<html></html>
Try setup height in tag img
.item > img {
width: 100%;
height: 100%;
}
you could use max-width and/or max-height on your img tags to make sure they keep ratio instead of transforming.
Go through your code and tidy it up, you've got the right idea of separating into rows then using divs within each row.
Here's one I very quickly mocked up, http://jsfiddle.net/8WKR9/5/ 1st and 3rd height are the same and 2nd and 4th are the same, i'm not getting any display errors so probably best going through your HTML & CSS and tidying it up, that way you can see what each part is doing and work out where it's going wrong, rather than try and find a quick fix, it'll also make your code cleaner and easier to read.
<html></html>