背景色引导程序将不会占据整页宽度

时间:2019-01-26 00:52:14

标签: css twitter-bootstrap jsx

我正在尝试使网站部分的背景颜色不同。我试图使padding和margin 0以及其他一些事情都无济于事。我在这里同时添加了CSS和HTML。

mapview.on("click", function(event) {
            // Get the coordinates of the click on the view
            // around the decimals to 3 decimals
            var lat = Math.round(event.mapPoint.latitude * 100000) / 100000;
            var lon = Math.round(event.mapPoint.longitude * 100000) / 100000;
            openForm(lat, lon);

function openForm(lat, lon){
        window.location.href = 'http://127.0.0.1:8000/form';
        alert("latitude: "+lat+" and longitude: "+lon);
}

CSS:

class MyForm(forms.ModelForm):
    created_date = forms.DateTimeField() 
    userid = forms.CharField()
    description = forms.CharField()
    latitude = forms.CharField()
    longitude = forms.CharField()

    def __init__(self, *args, **kwargs):
        #instance = kwargs.get('instance', None)
        kwargs.update(initial={
            # 'field': 'value'
            'latitude': 'this text will initially populate...',
            'created_date': 
        })
        super(MineralForm, self).__init__(*args, **kwargs)

1 个答案:

答案 0 :(得分:0)

欢迎使用Stackoverflow。 为什么使用className代替class? 我相信这是您的问题

请尝试这个

.team {
	margin: 4em 0;
	position: relative;
}
.team h1 {
	color:maroon;
}
.team .item {
	position: relative;
}
.team .des {
	background: maroon;
	color: #fff;
	margin-top:3px;
	text-align: center;
	transition:.3s ease-in-out;
}
.teamColor {
	background:pink;
	margin: 0 auto;
	min-height: 100%;
	min-width: 100%;
	padding: 0 auto;
	position: absolute;
}
<div class="team">
	<h1 class="text-center">Our Team</h1>
	<div class="row">
		<div class="col-lg-4 col-md-4 col-sm-12 item">
			<div class='circular'>
				<img src={nat} class="img-fluid" alt="team"/>
			</div>
			<div class="des">Natalie</div>
			<div class="text-muted">Manager</div>
		</div>
		<div class="col-lg-4 col-md-4 col-sm-12 item">
			<div class='circular'>
				<img src={rina} class="img-fluid" alt="team"/>
			</div>
			<div class="des">Rina</div>
			<div class="text-muted">Rina Schiller is a software engineer in the investment bank at JPMorgan Chase. She graduated from Hunter college in NYC with a major in digital media and minors in computer science and gender studies. She is very passionate about politics, gender equality, technology, and short hair.</div>
		</div>
		<div class="col-lg-4 col-md-4 col-sm-12 item">
			<div class='circular'>
				<img src={jules} class="img-fluid" alt="team"/>
			</div>
			<div class="des">Jules</div>
			<div class="text-muted">Front End Developer</div>
		</div>
	</div>
</div>

在这里,我得到的是栗色背景,而不是粉红色,因为在您的代码中没有class = teamColor元素