我需要帮助将background-size
代码缩减为background
属性。
代码:
<html style="background:black url('http://example.com/image.jpeg')center no-repeat;background-size:auto 125%;cursor:none">
我的尝试:
<html style="background:black url('http://example.com/image.jpeg')center auto 125% no-repeat;cursor:none">
任何其他减少代码的方法将不胜感激。另外,没有必要告诉我关于&lt; / HTML&GT;
答案 0 :(得分:2)
public class Employee
{
//Default constructor
public Employee()
{
Name = "Some other name";
Title = "Some other title";
}
//Static constructor
static Employee()
{
}
//Just a static method returning an Employee object
public static Employee GetEmployee()
{
//Object initializer using the default constructor
var emp = new Employee()
{
Name = "Somebody",
Title = "Developer"
};
return emp;
}
public string Name { get; set; }
public string Title { get; set; }
}
速记属性的官方W3C规范如下:https://www.w3.org/TR/css3-background/#the-background
size属性以背景位置和正斜杠后面的速记写入。例如:
background
相当于:
p { background: url("chess.png") 40% / 10em gray round fixed border-box; }