Jump to content

Images and video side by side


BIGB185

Recommended Posts

I'm attempting to add code to a class project that will display images on a page side by side.  I found the code here:  https://www.w3schools.com/howto/tryit.asp?filename=tryhow_css_images_side_by_side

The problems I'm having are that my instructor wants me to move the code from the "style" area of the code to a separate CSS file and link to that file in the code but when I move the code it doesn't work.  Also, I'd like to be able to make embedded videos on the site line up side by side as well but the code doesn't work for that at all.  All the other code in the CSS file is fine except for that bit of code.  

Any help would be appreciated.

Thanks ahead of time.

Link to comment
Share on other sites

Thanks, Funce for the reply.  The code I'm using is:  

<style>
* {
  box-sizing: border-box;
}

.column {
  float: left;
  width: 33.33%;
  padding: 5px;
}

/* Clearfix (clear floats) */
.row::after {
  content: "";
  clear: both;
  display: table;
}
</style>
 

Link to comment
Share on other sites

Try using a code block, so you can get colours and so your code doesn't get eaten by the formatting machine.

XcQfW3F.png

So for this, all you would need to do is move that CSS code to an external stylesheet.

your_stylesheet.css

* {
  box-sizing: border-box;
}

.column {
  float: left;
  width: 33.33%;
  padding: 5px;
}

/* Clearfix (clear floats) */
.row::after {
  content: "";
  clear: both;
  display: table;
}

 

and then link to that stylesheet with the <link> tag.

<link rel="stylesheet" type="text/css" href="your_stylesheet.css">

 

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...