我正在使用元素构建网站,并希望使用CSS样式表对元素进行样式设置。 css-和html文件都在同一文件夹中。但是,我的CSS更改不会导致我的网站发生更改。我有以下代码(我删除了一些文本)enter code here
:
div.contact {
top: 70px;
left: 300px;
width: 50%;
}
<div class="contact">
<br>
<p> Voor andere vragen kan u ons contacteren op: </p>
<br>
<br>
<br>
<br>
<a href="mailto: XXX"> XXX </a>
</div>
答案 0 :(得分:1)
您的CSS应该是
.contact {
position: absolute;
top: 70px;
left: 300px;
width: 50%;
}
答案 1 :(得分:0)
好的,我正在更改答案,以便您更好地理解, 如果要以位置(上/右/下/左)为首的比赛,则必须指定:
private fun startUpload() {
compositeDisposable.add(
// Check if another item is uploading
getFirstDeviceMediaByUploadStatusUseCase.execute(
GetFirstDeviceMediaByUploadStatusUseCase
.Params
.create(UploadStatus.UPLOADING))
.subscribeOn(executionThread.getIOThread())
.observeOn(executionThread.getMainThread())
.subscribe({
// If another item is uploading we do nothing
}, {
// If there is item with UPLOADING status then we will start upload first item waiting for upload
if (it is EmptyResultSetException) {
getFirstDeviceMediaByUploadStatusUseCase.execute(
GetFirstDeviceMediaByUploadStatusUseCase
.Params
.create(UploadStatus.WAITING))
.subscribeOn(executionThread.getIOThread())
.observeOn(executionThread.getMainThread())
.subscribe({ deviceMedia ->
// Start uploading
uploadDeviceMedia(deviceMedia)
}, {
VCLogger.i("No waiting files we should stop upload service")
stopForegroundService()
})
}
}))
}
private fun uploadDeviceMedia(deviceMedia: DeviceMediaEntity) {
compositeDisposable.add(
uploadDeviceMediaUseCase.execute(UploadDeviceMediaUseCase.Params.create(deviceMedia))
.subscribeOn(executionThread.getIOThread())
.observeOn(executionThread.getMainThread())
.doOnSubscribe {
VCLogger.i("Uploading... ${deviceMedia.path}")
deviceMedia.updatedAt = Date()
deviceMedia.uploadStatus = UploadStatus.UPLOADING
// Update device media status to UPLOADING
compositeDisposable.add(
updateDeviceMediaUseCase.execute(UpdateDeviceMediaUseCase.Params.create(deviceMedia))
.subscribeOn(executionThread.getIOThread())
.observeOn(executionThread.getMainThread())
.subscribe()
)
}
.subscribe({
VCLogger.i("Uploaded ${deviceMedia.path}")
deviceMedia.updatedAt = Date()
deviceMedia.uploadStatus = UploadStatus.UPLOADED
// Update device media status to UPLOADED then start upload another one
compositeDisposable.add(
updateDeviceMediaUseCase.execute(UpdateDeviceMediaUseCase.Params.create(deviceMedia))
.subscribeOn(executionThread.getIOThread())
.observeOn(executionThread.getMainThread())
.subscribe {
startUpload()
}
)
}, {
VCLogger.i("Failed to upload ${deviceMedia.path}")
deviceMedia.updatedAt = Date()
deviceMedia.uploadStatus = UploadStatus.FAILED
// Update device media status to FAILED then start upload another one
compositeDisposable.add(
updateDeviceMediaUseCase.execute(UpdateDeviceMediaUseCase.Params.create(deviceMedia))
.subscribeOn(executionThread.getIOThread())
.observeOn(executionThread.getMainThread())
.subscribe {
startUpload()
}
)
})
)
}
private fun stopForegroundService() {
VCLogger.i("Stop foreground service.")
// Stop foreground service and remove the notification.
stopForeground(true)
// Stop the foreground service.
stopSelf()
}
或
position:relative;
根据您的需求,
我不知道您是否发布了完整的代码,但是您应该尝试使用以下代码:
position: absolute;
.contact{
position: relative;
top: 70px;
left: 300px;
width: 50%;
}
.contact2{
position: absolute;
top: 70px;
left: 300px;
width: 50%;
}
.contact3{
padding-top: 70px;
padding-left: 300px;
width: 50%;
}
.contact4{
margin-top: 70px;
margin-left: 300px;
width: 50%;
}
您可以将课程切换为
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="contact" >
<br>
<p > Voor andere vragen kan u ons contacteren op: </p>
<br>
<br>
<br>
<br>
<a href="mailto: XXX"> XXX </a>
</div>
</body>
</html>
应该没事
答案 2 :(得分:0)
您需要确保样式表已加载到HTML中。为此,请在<head>
标签内添加以下内容:
<link rel="stylesheet" href="style.css">
也就是说,如果您的CSS文件名为style.css
。否则,只需更改名称即可。