我有单向的一对多关系。一侧是 PARENT,多侧是 CHILD。对于一位父母来说,可以有很多孩子。但对于一个孩子来说,只有一个父母。在Java方面,关系是单向的,我需要访问父母的孩子,但我不想为孩子存储父母。这些是对象:
\n家长:
\n@Entity\npublic class Parent {\n\n @Id\n @GeneratedValue(strategy = GenerationType.AUTO)\n private Long id;\n \n private String job;\n \n @OneToMany(targetEntity = Child.class, fetch = FetchType.EAGER, cascade = CascadeType.ALL)\n @JoinColumn(name = "PARENT_ID")\n private Set<Child> childs;\n\n public Long getId() { return id; }\n public void setId(Long id) { this.id = id; }\n public String getJob() { return job; }\n public void setJob(String job) { this.job = job; }\n\n public Set<Child> getChilds() {\n if(childs != null) { return childs; }\n …Run Code Online (Sandbox Code Playgroud) 我有一个页面,其中一个按钮标有字形(引导程序)。
我有一个新要求,即使用“Wave”工具( https://wave.webaim.org/extension/ )检查页面时不能出现“错误” 。
问题是 Wave 会抛出该按钮的错误,因为它是一个“空按钮”。
我尝试使用带有替代文本的图像。这修复了 Wave 错误,但它使按钮稍大一些,而且我也对为此滥用图像感到不安。
这是我的页面显示问题的最小版本:
<html lang="en">
<head>
<title>title</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" >
</head>
<body>
<div>
<button>
<span class="glyphicon glyphicon-chevron-up"></span>
</button>
</div>
<div>
<button>
<span class="glyphicon glyphicon-chevron-up"></span>
<img src="https://upload.wikimedia.org/wikipedia/commons/c/ce/Transparent.gif" alt="UP button">
</button>
</div>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
有没有比虚拟 img 更好的方法来确保可访问性(为字形提供替代文本)?