html - 如何在正确的内容页面上打开图像
问题描述
我正在尝试从侧边栏打开图像到右侧面板。它需要保持在同一页面上。
例如像这样的东西。https://www.w3schools.com/w3css/tryit.asp?filename=tryw3css_sidebar
假设链接 1 和链接 2 和链接 3 是图像,通过单击其中一个,我希望图像显示在您看到“我的页面”的右侧。
<!DOCTYPE html>
<html>
<title>W3.CSS</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
<body>
<!-- Sidebar -->
<div class="w3-sidebar w3-light-grey w3-bar-block" style="width:25%">
<h3 class="w3-bar-item">Menu</h3>
<a href="img_car.jpg" class="w3-bar-item w3-button">Link 1</a>
<a href="#" class="w3-bar-item w3-button">Link 2</a>
<a href="#" class="w3-bar-item w3-button">Link 3</a>
</div>
<!-- Page Content -->
<div style="margin-left:25%">
<div class="w3-container w3-teal">
<h1>My Page</h1>
</div>
<img src="img_car.jpg" alt="Car" style="width:100%">
<div class="w3-container">
<h2>Sidebar Navigation Example</h2>
<p>The sidebar with is set with "style="width:25%".</p>
<p>The left margin of the page content is set to the same value.</p>
</div>
</div>
</body>
</html>
解决方案
推荐阅读
- angular6 - Angular 6 ng lint select 已弃用
- python - 检查python中是否存在电子邮件地址
- php - PHP:Laravel 无法添加外键约束
- spring-mvc - @Value 在测试期间在@component 过滤器中不可见
- android - Firebase 完全相同的版本错误?
- spring - Spring Boot NoOp 后备 Bean
- node.js - 柴单元测试错误
- python - 从 Python 列表中过滤掉“None”,“str”对象不可调用
- openlayers - Openlayers 动画更改起点
- node.js - @google-cloud/speech 使用 v64-darwin 创建的节点模块,需要 v51