• Guest, before posting your code please take these rules into consideration:
    • It is required to use our BBCode feature to display your code. While within the editor click < / > or >_ and place your code within the BB Code prompt. This helps others with finding a solution by making it easier to read and easier to copy.
    • Don't share a wall of code. All we want is the problem area, the code related to your issue.


    To learn more about how to use our BBCode feature, please click here.

    Thank you, Code Forum.

HTML & CSS Image alignment

shaneh

New Coder
Hi all so i am just stepping into css and working my through trying to learn and wondered if anyone can help me with this please as im stuck - here is my code and image attached - im trying to get the image to align left so its the same as the text - many thanks
 

Attachments

  • Capture.JPG
    Capture.JPG
    32.7 KB · Views: 3
Last edited:

shaneh

New Coder
CSS:
<p><b></b></p>

<title></title>

<style type="text/css">* {

        box-sizing: border-box

      }

      body {

        font-family: Verdana, sans-serif;

        margin: 0

      }

      .mySlides {

        display: none

      }

      img {

        vertical-align: middle;

      }

      .slideshow-container {

        max-width: 800px;

        position: static;

        margin: auto;

      }

      /* Next & previous buttons */

      .prev,

      .next {

        cursor: pointer;

        position: absolute;

        top: 50%;

        width: auto;

        padding: 16px;

        margin-top: -22px;

        color: white;

        font-weight: bold;

        font-size: 25px;

        transition: 0.6s ease;

        border-radius: 0 3px 3px 0;

        user-select: none;

      }

      /* Position the "next button" to the right */

      .next {

        right: 0;

        border-radius: 3px 0 0 3px;

      }

      /* On hover, add a black background color with a little bit see-through */

      .prev:hover,

      .next:hover {

        background-color: rgba(0, 0, 0, 0.8);

      }

      /* Caption text */

      .text {

        color: #ffffff;

font-weight: bold;

        font-size: 16px;

        padding: 8px 12px;

        position: absolute;

        bottom: 8px;

        width: 100%;

        text-align: center;

      }

      /* Number text (1/3 etc) */

      .numbertext {

        color: #ffffff;

font-weight: bold;

        font-size: 16px;

        padding: 8px 12px;

        position: absolute;

        top: 0;

      }

      /* The dots/bullets/indicators */

      .dot {

        cursor: pointer;

        height: 20px;

        width: 20px;

        margin: 0 2px;

        background-color: #999999;

        border-radius: 50%;

        display: inline-block;

        transition: background-color 0.6s ease;

      }

      .active,

      .dot:hover {

        background-color: #111111;

      }

      /* Fading animation */

      .fade {

        -webkit-animation-name: fade;

        -webkit-animation-duration: 1.5s;

        animation-name: fade;

        animation-duration: 1.5s;

      }

      @-webkit-keyframes fade {

        from {

          opacity: .4

        }

        to {

          opacity: 1

        }

      }

      @keyframes fade {

        from {

          opacity: .4

        }

        to {

          opacity: 1

        }

      }

      /* On smaller screens, decrease text size */

      @media only screen and (max-width: 300px) {

        .prev,

        .next,

        .text {

          font-size: 11px

        }

      }

</style>

<div class="slideshow-container">

<div class="mySlides fade">

<div class="numbertext">Standard Printer ICC on ceramic tile</div>

<img src="/user/news/thumbnails/Generic-Printer-1.jpg" style="width:100%" />

<div class="text">&copy;</div>

</div>
 

OldMan

King Coder
I can't make out an image from post #1 so I used one of mine. Everything looks good with no CSS, but I get a black page once I add your CSS>
Looked for display:none in the CSS - found it in .mySlides. Remove it and the image and the text look good. but not aligned left like you want.
In .slideshow-container I remove display:static (The default) and margin: auto(which centers things and everything move left.

Is this what you want?
 
Top