首页 \ 问答 \ 更改背景大小:从左上角到右上角覆盖锚点(Changing background-size:cover anchor from top left to top right)

更改背景大小:从左上角到右上角覆盖锚点(Changing background-size:cover anchor from top left to top right)

我正在创建一个单页网站,其中的图像覆盖整个背景(并与窗口成比例延伸)。 为此,我使用的是“背景尺寸:封面;”

现在,当我将窗口调整到最小尺寸时,它就是我,背景图像似乎锚定到默认的左上角。

我有什么方法可以将锚定位置更改为右上角?


I'm creating a one page website with an image that covers the entire background (and stretches proportionally with the window). For this I'm using a "background-size: cover;"

Now, when I'm resizing the window to the smallest size it let's me, the background image seems to anchor to the default top left corner.

Is there any way for me to change the anchoring location to top right?


原文:https://stackoverflow.com/questions/13618167
更新时间:2023-03-17 16:03

最满意答案

您的提交按钮位于<form>元素之外。 通过Enter键提交是一个浏览器功能,而不是AngularJS的功能。

点击Enter时 ,浏览器尝试查找找到的第一个提交按钮,并通过模拟click事件来提交表单。 当提交按钮位于<form> ,浏览器将不执行任何操作。

有关更多信息,您可以检查隐式提交规范


Your submit button is outside of the <form> element. Submit via Enter key is a browser feature, not a feature of AngularJS.

When hitting Enter the browser tries to find finds first submit button and submits the form by emulating click event on it. When the submit button is outside of your <form>, browser will do nothing.

For more information you can check the specification of implicit submission.

相关问答

更多
  • 您可以将interval属性设置为-ve或0整数以暂停轮播 显然,可以使用任何数据绑定变量设置interval ,其中-ve或0作为值 You can set interval attribute to -ve or 0 integer to pause the carousel Obviously interval can be set with any data-bound variabl ...
  • 在我开发的一些项目中,我遇到了同样的问题,我总是设置min-height 。 我想我找到了一个解决方案。 刚刚添加 .form-inline .ui-select-container input.form-control.ui-select-search.ng-hide { display: block !important; visibility: hidden; height: 0; border: 0; padding: 0; } http://plnkr.co/edit/b1C ...
  • 我不得不更新到angular-ui 1.3.3,然后我必须给日期输入一个名字'datepicker',形式一个名字'frm'然后
    some error message
    我没有清除该字段,因为如果用户没有完成输入它将无效,因此可能被清除。 如果有人有更好的解决方案, ...
  • 有关更多信息,请参阅此文章 。 下面是一段代码,演示如何使用ng-keypress有条件地登录到控制台: angular.module('myExample', []) .controller('myController', ['$scope', function($scope) { $scope.myFunction = function() { console.log('hi!'); } }]);