我有这个CSS:
sqrt::before {
border: none;
content: "√";
}
sqrt {
content: attr(expr);
border-top: 1px solid black;
}
::before
伪元素有边框。
我故意指定border: none;
来避免这种情况。
答案 0 :(得分:0)
::before
上没有边框。问题是您的sqrt
- 元素位于sqrt::before {
border: none;
content: "√";
position: absolute;
left: 0;
}
sqrt {
content: attr(expr);
border-top: 1px solid black;
margin-left:2px;
}
- 元素内。
试试这段代码:
::before
它将sqrt
绝对定位到sqrt
- 元素,并将::before
- 元素移离public String loadJSONFromAsset() {
String json = null;
try {
InputStream is = getActivity().getAssets().open("yourfilename.txt");
int size = is.available();
byte[] buffer = new byte[size];
is.read(buffer);
is.close();
json = new String(buffer, "UTF-8");
} catch (IOException ex) {
ex.printStackTrace();
return null;
}
return json;
}
,从而创建所需的效果。