How do I put two images side-by-side in my documentation?
Asked on 2024-07-30
1 search
To put two images side-by-side in your documentation, you can use HTML and CSS. Here is a simple example:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Side-by-Side Images</title>
<style>
.container {
display: flex;
}
.container img {
margin: 5px;
}
</style>
</head>
<body>
<div class="container">
<img src="image1.jpg" alt="Image 1" width="300">
<img src="image2.jpg" alt="Image 2" width="300">
</div>
</body>
</html>
In this example, the container class uses the flex display property to arrange the images side-by-side. You can adjust the width attribute of the img tags to control the size of the images.
For more advanced usage, such as integrating images into attributed strings or handling images in different contexts, you might find the following sessions from WWDC useful:
- Bring expression to your app with Genmoji - This session covers how to use
NSAdaptiveImageGlyphto include images in attributed strings. - Get started with Dynamic Type - This session discusses handling images and symbols in dynamic layouts, which might be useful if you need to ensure your images scale properly with text.
If you need more specific guidance on handling images in your app, feel free to ask!

Bring expression to your app with Genmoji
Discover how to bring Genmoji to life in your app. We’ll go over how to render, store, and communicate text that includes Genmoji. If your app features a custom text engine, we’ll also cover techniques for adding support for Genmoji.

Optimize for the spatial web
Discover how to make the most of visionOS capabilities on the web. Explore recent updates like improvements to selection highlighting, and the ability to present spatial photos and panorama images in fullscreen. Learn to take advantage of existing web standards for dictation and text-to-speech with WebSpeech, spatial soundscapes with WebAudio, and immersive experiences with WebXR.

Evolve your document launch experience
Make your document-based app stand out, and bring its unique identity into focus with the new document launch experience. Learn how to leverage the new API to customize the first screen people see when they launch your app. Utilize the new system-provided design, and amend it with custom actions, delightful decorative views, and impressive animations.
