我有两个内部div,它们嵌套在一个包装div中.我希望两个内部div一个接一个地排列.但截至目前,他们正在安排在同一条线上.
#wrapper{
margin-left:auto;
margin-right:auto;
height:auto;
width:auto;
}
#inner1{
float:left;
}
#inner2{
float:left;
}
Run Code Online (Sandbox Code Playgroud)
CSS是
<div id="wrapper">
<div id="inner1">This is inner div 1</div>
<div id="inner2">This is inner div 2</div>
</div>Run Code Online (Sandbox Code Playgroud) 我正在尝试建立一个网站,但我遇到了问题.当我在Chrome中运行它时,我得到:"无法设置未定义的属性'backgroundColor'".我不明白为什么我得到这个.我的var不是数组(只是一个id).我一直在谷歌上搜索2个小时,但没有任何帮助我.
这是我的HTML代码:
$(document).ready
(
function()
{
$("#go").bind("click", remonte)
}
);
function remonte(){
$("#menu").animate({marginTop: "-460"}, 500);
$("#ar").animate({marginTop: "120"}, 500);
$("#reste").animate({height: "500", marginTop: "-50"},400);
$("#go").remove();
setTimeout(charge, 510);
}
function charge(){
$('#reste').load("about.html",'',montreNouveauContenu);
$("#surmenu").style.backgroundColor="transparent"; //HERE
$("#menu_jaune").animate({width: "900"}, 500);
}
function montreNouveauContenu() {
$('#content').show('normal');
}
function suppr(){
$("#dev").remove();
$("#reste").remove();
$("#content").remove();
$("#bandeau_graphisme").animate({height: "255"},500);
}Run Code Online (Sandbox Code Playgroud)
我的Javascript代码:
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
<head>
<title>Folio</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<link rel="stylesheet" type="text/css" href="style.css"/>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
<script type="text/javascript" src="anim2.js"></script>
</head> …Run Code Online (Sandbox Code Playgroud) 注意:我已将我的 Sapper 应用程序迁移到 SvelteKit(下面的更新 3),因此现在正在寻找 SvelteKit 的解决方案。我有多个使用 Sapper 构建的 MFE(微前端),它们位于不同的服务器下。在一个 MFE 中有一个 svelte 组件(用于渲染 HTML 内容),我想在另一个 MFE 中调用/渲染它。我怎样才能做到这一点?我尝试同时在本地运行/服务两个 MFE 并执行了 fetch(route-that-loads-component),但它在响应中返回 POJO,我不知道如何处理它:
Response {
size: 0,
timeout: 0,
[Symbol(Body internals)]: {
body: Gunzip {
_writeState: [Uint32Array],
_readableState: [ReadableState],
_events: [Object: null prototype],
_eventsCount: 5,
_maxListeners: undefined,
_writableState: [WritableState],
allowHalfOpen: true,
bytesWritten: 0,
_handle: [Zlib],
_outBuffer: <Buffer 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 f7 7f 00 00 41 ff e2 55 …Run Code Online (Sandbox Code Playgroud)