看看这个横幅:
http://schart.net/newbanas.png
我可以使用CSS制作这种条纹图案吗?我希望这能改变容器的宽度,所以它应该是CSS.
我正在制作一个投资组合,我想用这种风格的背景来梳理部分.
我在 Fortran 95 中编写了一个基本算法,使用通过称为理查森外推法的过程增强的中心差来计算函数的梯度(代码中规定了一个示例)。
function f(n,x)
! The scalar multivariable function to be differentiated
integer :: n
real(kind = kind(1d0)) :: x(n), f
f = x(1)**5.d0 + cos(x(2)) + log(x(3)) - sqrt(x(4))
end function f
!=====!
!=====!
!=====!
program gradient
!==============================================================================!
! Calculates the gradient of the scalar function f at x=0using a finite !
! difference approximation, with a low order Richardson extrapolation. !
!==============================================================================!
parameter (n = 4, M = 25)
real(kind = kind(1d0)) :: x(n), xhup(n), xhdown(n), …Run Code Online (Sandbox Code Playgroud) 我已经用谷歌搜索并阅读了很多内容,但没有找到适合我需要的答案,所以我会在这里问:
我想在我的 JFrame 中有一个渐变背景。目前背景是单色的。我的代码看起来像这样:
//imports
public class Game {
//some other irrelevant instance variables
JFrame frame = new JFrame("Game");
public Game() {
frame.getContentPane().setBackground(new Color(200,220,200));
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setLayout(null);
frame.setPreferredSize(new Dimension(frameX,frameY)); //frameX and frameY are instance variables
getMenu(); //method that adds a few JLabels to the JFrame and so on
}
}
Run Code Online (Sandbox Code Playgroud)
我读过的方法适用于扩展 JPanel 或 JFrame 的类(然后使用 GradientPaint 或类似的东西),但正如您所看到的,我使用 JFrame 作为实例变量。有人可以帮我吗?
编辑: 图片:

我正在尝试将元素的背景设置为渐变,但它没有设置。它添加style=""到标记中,当我将代码直接放入 firebug 时(我使用的是 Firefox),它会起作用。知道为什么它不起作用或我如何让它工作吗?
$('main > article').each(function (index) {
var bg = $(this).css('background-color');
var nextbg = $(this).next().css('background-color');
if ($(this).next().length && nextbg != bg) {
$(this).css('background', 'linear-gradient(to bottom, ' + bg + ' 0%, ' + nextbg + ' 100%);');
console.log('linear-gradient(to bottom, ' + bg + ' 0%, ' + nextbg + ' 100%);');
console.log('------------');
}
});
Run Code Online (Sandbox Code Playgroud) 我有这行代码
background:linear-gradient(341deg, #8a8a8a 0%, #8a8a8a 31.9%, #000 32.1%, #000 100%);
正如你所看到的,它一半灰色一半黑色。有没有办法让它的灰色部分透明,这样它就变成半透明半黑了。
预先感谢,凯文
目前,我有一个脚本(通过 GIMP 中的 .py 插件)可以生成带有渐变的SVG 路径(通过具有不同宽度和颜色的相同路径的多个路径来模拟)。
但是,我想知道是否有一种语法可以生成类似的东西而无需定义多个路径。
就像只是定义一个渐变和单个路径。
我已经搜索了像 svg 路径渐变这样的关键字,到目前为止我发现的所有渐变都是沿着路径变化的渐变与上面显示的完全不同,所以我只是想知道我是否没有使用正确的关键字或什么?或者如果这样的事情存在。
我想在按钮背景上实现精确的效果,但还没有成功..!有什么帮助吗?
这是图像
到目前为止我的尝试(gradient_bg.xml)
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient
android:angle="90"
android:endColor="@android:color/transparent"
android:startColor="#e3ffffff" />
</shape>
Run Code Online (Sandbox Code Playgroud)
..结果并没有那么多..!
布局
<TextView
fontPath="fonts/Roboto-Regular.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start"
android:layout_marginBottom="-20dp"
android:gravity="start"
android:text="@string/dummy_big"
android:textColor="@color/gray_dark"
android:textSize="13sp"
tools:ignore="MissingPrefix" />
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/gradient_bg">
<Button
fontPath="fonts/Roboto-Bold.ttf"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_gravity="center"
android:layout_marginStart="120dp"
android:layout_marginTop="20dp"
android:layout_marginEnd="120dp"
android:layout_marginBottom="20dp"
android:background="@drawable/round_solid_primary"
android:clickable="true"
android:foreground="?selectableItemBackground"
android:gravity="center_vertical|center_horizontal"
android:text="@string/view_more"
android:textColor="@color/ef_white"
android:textSize="15sp"
tools:ignore="MissingPrefix" />
</FrameLayout>
Run Code Online (Sandbox Code Playgroud) 我正在尝试在登陆页面上实现全屏渐变。我正在使用 bootstrap,如果我在 CSS 文件中使用 HTML 标签,那么它会覆盖内容末尾下方的屏幕,但如果我使用 body 标签,那么它会覆盖相反的内容,即所有内容。body标签渐变封面截图
/* Title Section */
#title {
padding-top: 22%;
}
h1 {
text-align: center;
font-size: 60px !important;
}
.title-buttons {
padding-top: 2%;
}
.title-btn1 {
margin-left: 35%;
}
.title-btn2 {
float: right;
margin-right: 35%;
}
body {
background-color: #FF3CAC;
background-image: linear-gradient(225deg, #FF3CAC 0%, #784BA0 50%, #2B86C5 100%);
background-repeat: no-repeat;
background-repeat: no-repeat;
background-size: cover;
min-width: 100%;
min-height: 100%;
}Run Code Online (Sandbox Code Playgroud)
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Alec Klem</title>
<link rel="stylesheet" href="/Users/alecklem/Desktop/Web Development/MySite/MySite-Master/css/style.css">
<!-- Bootstrap …Run Code Online (Sandbox Code Playgroud)我想慢慢地从 0% 模糊过渡到 100% 模糊。
理想情况下,我可以使用线性渐变语法backdrop-filter: linear-gradient(blur(8px), blur(8px), blur(0));,但这似乎不受支持。
有任何想法吗?