与nth-child的css网格(css grid with nth-child)
是否可以使用nth-child创建不均匀列的重复模式? 这就是我所拥有的,但它只适用于第一行:
.three-cols > div:nth-child(1n) { width: 50%; } .three-cols > div:nth-child(2n) { width: 25%; } .three-cols > div:nth-child(3n) { width: 25%; } .three-cols > div:nth-child(3n) { margin-right: 0; }
所以我希望每一行分开:50%,25%,25%
Is it possible to create a repeating pattern of uneven columns using nth-child? This is what I have, but it only works for the first row:
.three-cols > div:nth-child(1n) { width: 50%; } .three-cols > div:nth-child(2n) { width: 25%; } .three-cols > div:nth-child(3n) { width: 25%; } .three-cols > div:nth-child(3n) { margin-right: 0; }
So I want every row split:50%,25%,25%
原文:https://stackoverflow.com/questions/40487553
更新时间:2023-07-22 20:07
最满意答案
我编辑了我的答案。 这个例子现在工作正常!
I edited my answer. The example works fine now!
相关问答
更多-
将json从ajax jquery发送到接收模型的控制器(Send json from ajax jquery to a controller that receive a model)[2023-07-01]
您应该能够简化并仅将数据发布为json。 请特别注意type,contentType和data属性。 $.ajax({ cache: false, url: '@Url.Action("InsertPerson", "JsonTest")', type: "POST", contentType: "application/json", data: JSON.stringify(person1), succ ... -
我认为Django的csrf漏洞利用保护正在发挥作用。 一个解决方法是通过使用@csrf_exempt装饰get_candidate_prices_and_xpaths来关闭保护(即在此函数之前添加一行,其中只有'@csrf_exempt',并且在django.views.decorators.csrf导入csrf_exempt中的文件中更早) “)。 我的API遇到了类似的问题。 更好的解决方案是将相关片段嵌入页面的模板中。 csrf Django功能是在浏览页面时避免安全漏洞--Django文档解释了更 ...
-
你需要有一个XMLHttpRequest()的实例来使用open()方法,所以添加下面这行代码: var xmlHttp = new XMLHttpRequest(); 在你使用open()方法之前,像这样: xmlHttp.open("POST", "../JSONServlet", true); 编辑: - 你也有一个错误,正如@james指出的那样,在你做initAjax函数的时候你有一个变量xmlhttp ,因为你的全局变量是xmlHttp ,两者都不一样。 You need to have ...
-
Ajax Servlet问题(Ajax Servlet Issue)[2024-03-10]
看起来你没有阻止默认的非ajax表单提交触发。 您的函数可以使用事件参数,您可以使用它来防止默认值。 $(document).ready( function () { $('#searchform').submit( function(event) { event.preventDefault(); //rest of code } ); ... -
首先,如果要发送JSON Body,则需要使用POST。 GET只在URL中有变量,这对您不起作用。 同样在Web开发中,一般的共识是您使用POST从用户提交数据。 我已成功使用此功能,测试是使用邮递员完成的: POST: { "username":"00346845869585", "password":"test" } @Controller @EnableAutoConfiguration public class SampleController { @RequestMap ...
-
HTTP请求可以是POST或GET但不是两者都有,并且您的代码试图通过$_POST和$_GET来访问变量,这是不行的。 我建议改用$_REQUEST ,它会照顾它(如果是POST或GET)。 尽管使用了type: "POST" ,但jQuery会将其视为“GET”请求,因为您指向带有查询字符串的URL。 HTTP request can be POST or GET but not both and your code is trying to access variables through $_POST ...
-
首先, datatype参数指定输出数据的类型,而不是输入的数据。 其次, data参数应该给出一个参数字典,在这种情况下,其中一个参数是已经被字符串化的JSON对象: var jsondata = {"author":"TEST", "title":"XYZ"}; $.ajax({ type : 'POST', dataType : 'json', data: { jsondata : JSON.stringify(jsondata)}, url : '/submitqu ...
-
为什么servlet不发送json自定义字符串或Ajax不接收它?(Why servlet don't send json custom string or Ajax don't receive it?)[2021-09-26]
我编辑了我的答案。 这个例子现在工作正常! I edited my answer. The example works fine now! -
没有cookie的Servlet会话+仅返回JSON的ajax请求(Servlet session without cookies + ajax requests that only return JSON)[2022-06-06]
您已正确识别处理Tomcat支持的会话ID的三种方法中的两种。 第三种方法是跟踪会话,但仅限于应用程序通过SSL运行。 在这种情况下,您可以将Tomcat配置为使用SSL会话ID。 如果Servlet调用request.getSession(),则Tomcat始终在响应中包含会话ID。 但是,默认情况下,这些cookie在Tomcat 7以后标记为httpOnly,这意味着它们对javascript不可见(以防止试图窃取cookie的XSS攻击)。 如果会话cookie需要对脚本可见,那么您需要在Web应用 ... -
检查servlet映射是否正确写入web.xml 请参考此网址点击此处 Check servlet mapping is correctly written in web.xml please refer this url click here