Skip to main content
Participant
Jan 10, 2019 3:32 PM UTC
Answered

How to call out in CSS

I have these two images I'm trying to upload into my website. (I'm using Squarespace).

Here is my HTML:

<div style="margin-left:1100px; margin-top:30px; z-index:99999; position:absolute;"><img src="https://static1.squarespace.com/static/5c15633e9d5abb17ab5faaac/t/5c3531e3c2241bf9e4b37f72/1546990051469/France+C16-7.jpg.sqs-block-content a, .sqs-block-content a:visited {border: none !important;}" width="128" height="128""></div>

  

   <div style="margin-left:730px; margin-top:30px; z-index:99999; position:absolute;"><img src="https://static1.squarespace.com/static/5c15633e9d5abb17ab5faaac/t/5c3532b04ae237db71f7e72d/1546990256409/US+2+pair.jpghttps://static1.squarespace.com/static/5c15633e9d5abb17ab5faaac/t/5c3531e3c2241bf9e4b37f72/1546990051469/France+C16-7.jpg.sqs-block-content a, .sqs-block-content a:visited {border: none !important;}" width="170" height="128""></div>

Question:

I want to fix the positioning of them: how do I call these elements out in CSS? I don't have a class name or a div name for them, so how can I call them out?

Thanks!

This topic is closed to new replies. Start a new post to keep the conversation going.
Jon Fritz
Jon FritzCorrect answer
Community Expert
Jan 10, 2019 5:54 PM UTC

You have some malformed css in your code currently. It looks to me like you may have tried to copy/paste some styles from an external .css file directly into the image, right after the .jpg of each. That needs to be removed.

To target a specific image, all you need to do is add a unique ID to it (IDs can only be used once in any given page)...

<img id="myimage1" src="path/to/image1.jpg" alt="pithy text">

<img id="myimage2" src="path/to/image2.jpg" alt="more pithiness">

Then, in your css file, target the IDs...

#myimage1 {

     width:150px;

     height:200px;

}

#myimage2{

     width:170px;

     height:180px;

}

3 replies

Nancy OShea
Community Expert
Community Expert
Jan 10, 2019 7:21 PM UTC

See Squarespace Help -- Using Code Injection.

https://support.squarespace.com/hc/en-us/articles/205815908-Using-Code-Injection

Translate
Nancy O'Shea— Product User & Community Expert
Jon Fritz
Community Expert
Jon FritzCommunity ExpertCorrect answer
Community Expert
Jan 10, 2019 5:54 PM UTC

You have some malformed css in your code currently. It looks to me like you may have tried to copy/paste some styles from an external .css file directly into the image, right after the .jpg of each. That needs to be removed.

To target a specific image, all you need to do is add a unique ID to it (IDs can only be used once in any given page)...

<img id="myimage1" src="path/to/image1.jpg" alt="pithy text">

<img id="myimage2" src="path/to/image2.jpg" alt="more pithiness">

Then, in your css file, target the IDs...

#myimage1 {

     width:150px;

     height:200px;

}

#myimage2{

     width:170px;

     height:180px;

}

Translate
Abambo
Community Expert
Community Expert
Jan 10, 2019 3:39 PM UTC

Discussion successfully moved from Adobe Creative Cloud to Dreamweaver support forum

I moved this to the Dreamweaver support forum, but it is probably even not an Adobe related question.

I would look here: W3Schools Online Web Tutorials

Translate
ABAMBO | Hard- and Software Engineer | Photographer