HTML question
- Started
- Last post
- 17 Responses
- CygnusZero4
Is it possible to butt 2 images right up against each other? The page seems to be forcing about 5px or so of space in between them.
- ArmandoEstrada0
link?
- CygnusZero40
Internal for a massive company, cannot be shared.
- brandelec0
be default it should. there may be a border or margin set in CSS perhaps?
- dibec0
<div><img src="image1.jpg"/><img src="image2.jpg"/></div>
- ukit20
Just make sure margin, padding are both set to zero and that there is no border around the image. Use web inspector tool and you can see what styles are being applied.
- vaxorcist0
there may be some stylesheet already setup that has a built in margin, so you may have to over-ride it locally
<div><img src="1.jpg" style="margin:none;"><img src="2.jpg" style="margin:none;"></div>
or something like this....
- IRNlun60
Yes, should be possible.
Floating images will align them horizontally with no space, but the parent container for all images needs to be cleared.
If you're using display: inline-block to align images horizontally, there's a 4px space added. You can either margin-right: -4px; or remove space between elements in html which is not always ideal...
- CygnusZero40
Borders and margins set to 0. Just insists on there being about 5px or so of space between. And Im not using CSS at all, since this code is just being pasted into a sharepoint 2007 source editor.
- renderedred0
Are you sure the images have no margin in the files? Like a white border?
- renderedred0
this has to work:
<div><img src="1.jpg" style="float:left;margin:0;padding:0;display:block;"><img src="2.jpg" style="float:left;margin:0;padding:0;display:block;"></div>
- CygnusZero40
Very sure, I made them myself. Ive tried everything mentioned here, they wont butt up right next to each other, touching each other. So irritating.
- CygnusZero40
That worked rendered, but all I used was the code in the style tag on only the top image, so Im not sure why that fixed it. Thanks though.
- ArmandoEstrada0
<div class="myimage">
<img src="http://placekitten.com/g/200/200">
<img src="http://placekitten.com/g/200/200">
</div>.myimage img{
display:table-cell;
margin:0;
padding:0;
float:left;
}http://codepen.io/macisbetter/pe…
????
- vaxorcist0
One thing to check, is the Sharepoint 2007 system re-writing your code before it goes to the browser?
comment your code or use DIV names like div id="myname-part1" so you can more easily compare source code between the LIVE version and what you think you wrote into the CMS....
- BabySnakes0
font-size: 0; for the Image container if you have no control of the markup output.
- oey0
BUMP!