IT Certifications and Careers (Official Discussion Thread)

TRFG

Not who you think
Joined
Mar 7, 2014
Messages
13,798
Reputation
300
Daps
38,508
Are you talking about aligning them differently, like the text is on the left side of the page and the image is on the right side?

I mean't the images on the same line and the text are below them on line below, similar to when you hit the tab button in word.
 

kevm3

follower of Jesus
Supporter
Joined
May 2, 2012
Messages
16,289
Reputation
5,551
Daps
83,478
its similar to the image layout in google images. (horizontal layout image next to each other with an indentation separating them)

Use the float property on the image... for example:
float: left;

and then change the margin
margin-right: 10%; (or px if you're using px)

Code:
<!DOCTYPE html>
<html lang="en">
<head>
   <meta charset="UTF-8">
   <title>Document</title>
   <style>
     #a
     {
       height: 100px;
       width: 100px;
       background-color: black;
       margin-right: 5%;   
       float: left;
     }
   
   </style>
</head>
<body>
   <div id="a"></div>
   
   <p class= "imgtext">
   Lorem ipsum dolor sit amet, consectetur adipisicing elit. Voluptatibus temporibus natus, tempore dicta totam quaerat minus labore. Sapiente soluta animi facilis earum, delectus tempora similique recusandae aperiam! Dolores, cupiditate in?
   </p>
</body>
</html>
[/code]
 

TRFG

Not who you think
Joined
Mar 7, 2014
Messages
13,798
Reputation
300
Daps
38,508
Use the float property on the image... for example:
float: left;

and then change the margin
margin-right: 10%; (or px if you're using px)

Code:
<!DOCTYPE html>
<html lang="en">
<head>
   <meta charset="UTF-8">
   <title>Document</title>
   <style>
     #a
     {
       height: 100px;
       width: 100px;
       background-color: black;
       margin-right: 5%; 
       float: left;
     }
 
   </style>
</head>
<body>
   <div id="a"></div>
 
   <p class= "imgtext">
   Lorem ipsum dolor sit amet, consectetur adipisicing elit. Voluptatibus temporibus natus, tempore dicta totam quaerat minus labore. Sapiente soluta animi facilis earum, delectus tempora similique recusandae aperiam! Dolores, cupiditate in?
   </p>
</body>
</html>
[/code]

Why does the image file go? I have in my html file

<figure> <a href="images/closeup500.jpg" target="_blank" ><img src="images/closeup1800.jpg"alt="Photograph of Sunflowers"title="Wave." width="75" height="50" /> </a>
<figcaption>This image will open in a new page.</figcaption>
</figure>

AND

<figure> <a href="images/closeup500.jpg" ><img src="images/closeup500.jpg"alt="Photograph of Sunflowers"title="Photograph of Sunflowers." width="75" height="50" /> </a>
 

kevm3

follower of Jesus
Supporter
Joined
May 2, 2012
Messages
16,289
Reputation
5,551
Daps
83,478
Why does the image file go? I have in my html file

<figure> <a href="images/closeup500.jpg" target="_blank" ><img src="images/closeup1800.jpg"alt="Photograph of Sunflowers"title="Wave." width="75" height="50" /> </a>
<figcaption>This image will open in a new page.</figcaption>
</figure>

AND

<figure> <a href="images/closeup500.jpg" ><img src="images/closeup500.jpg"alt="Photograph of Sunflowers"title="Photograph of Sunflowers." width="75" height="50" /> </a>

Assuming you want text to appear to the right of those images wrapped in the figure tags:
Create a new class called imgAlign and attach it to the figure tags
<figure class ="imgAlign">

Then define the css
.imgAlign
{
float: left;
margin-right: 2%;
}
 

TRFG

Not who you think
Joined
Mar 7, 2014
Messages
13,798
Reputation
300
Daps
38,508
Assuming you want text to appear to the right of those images wrapped in the figure tags:
Create a new class called imgAlign and attach it to the figure tags
<figure class ="imgAlign">

Then define the css
.imgAlign
{
float: left;
margin-right: 2%;
}
ok that worked but there not on the same line
 

TRFG

Not who you think
Joined
Mar 7, 2014
Messages
13,798
Reputation
300
Daps
38,508
hit printscreen and upload the picture because I'm having a tough time visualizing exactly what it is you're trying to do
I should of done this first.
u5HMAtL.png
http://imgur.com/u5HMAtL Look above the <ul> lists. I'm trying to get both the images and text on the same lines
 

kevm3

follower of Jesus
Supporter
Joined
May 2, 2012
Messages
16,289
Reputation
5,551
Daps
83,478
Yes:mjcry: without the borders

On your figure element, set the css property display to inline-block

figure
{
display: inline-block;
}

also, set the picture to inline-block as well. Then, use the margin property to adjust your spacing. Use text-align: center on both elements as well.
Here is the example I showed you:
http://codepen.io/kevm3/pen/bNXvjo/

Edit it so you can understand what is going on.
 

TRFG

Not who you think
Joined
Mar 7, 2014
Messages
13,798
Reputation
300
Daps
38,508
On your figure element, set the css property display to inline-block

figure
{
display: inline-block;
}

also, set the picture to inline-block as well. Then, use the margin property to adjust your spacing. Use text-align: center on both elements as well.
Here is the example I showed you:
http://codepen.io/kevm3/pen/bNXvjo/

Edit it so you can understand what is going on.

I got it working with a little tweaking of your code. I work it working now I'll I need is to get that image in the text "This is some text that is placed in the transparent box."

I added
h3.transparentbox{
color: #000000;
background-image:url("../images/fielslong.jpg");
background-repeat: no-repeat;
margin: 20px;
padding: 30px;
opacity: 0.4;
max-width: 100%

but the image nor text from the html doesnt show
 
Top