我想知道如何在div中创建多个列.这是一个页脚,我想要一个站点地图,社交媒体链接等.
我打算使用,<multicol>但后来我读到它已被弃用,所以它让我不再使用它.
基本上我有80%宽的DIV,我需要三列.优选地每个都具有边际.
CSS:
div.bottom
{
height: 200px;
width: 80%;
margin-left: auto;
margin-right: auto;
margin-top: none;
margin-bottom: none;
border-top: 4px solid #00ccff;
border-bottom-left-radius: 15px;
border-bottom-right-radius: 15px;
background-color: #575757;
}
Run Code Online (Sandbox Code Playgroud)
我现在只需要HTML.感谢您的时间.
我使用下面的方法来制作带圆角的位图.现在我想在位图周围画一条线.
private BitmapDrawable roundCornered(BitmapDrawable scaledBitmap, int i) {
Bitmap bitmap = scaledBitmap.getBitmap();
result = Bitmap.createBitmap(bitmap.getWidth(), bitmap.getHeight(),
Bitmap.Config.ARGB_8888);
canvas = new Canvas(result);
color = 0xff424242;
paint = new Paint();
rect = new Rect(0, 0, bitmap.getWidth(), bitmap.getHeight());
rectF = new RectF(rect);
roundPx = i;
paint.setAntiAlias(true);
canvas.drawARGB(0, 0, 0, 0);
paint.setColor(Color.BLUE);
canvas.drawRoundRect(rectF, roundPx, roundPx, paint);
paint.setXfermode(new PorterDuffXfermode(Mode.SRC_IN));
canvas.drawBitmap(bitmap, rect, rect, paint);
BitmapDrawable finalresult = new BitmapDrawable(result);
return finalresult;
}
Run Code Online (Sandbox Code Playgroud)
我得到了下面的图片,但我的实际需要是我必须在图像周围画一个边框.

我想强调我的导航菜单,但问题是我需要它更厚,所以我使用底部边框,以便我可以将宽度设置为6px.
我似乎可以弄清楚如何使边框看起来更接近文本.目前文本和底部边界之间似乎有10px的差距,我不希望有任何差距.
我试图定位另一个div并将其相对于每个{li}与{bottom:10px}相对应,但我似乎无法让它工作.
这就是我所拥有的
码
<div id="menu">
<ul>
<li><a href="#home">home</a></li>
<li><a href="#about">About</a></li>
<li><a href="#contact">Contact</a></li>
</ul>
</div>
Run Code Online (Sandbox Code Playgroud)
CSS
#menu {
position: fixed;
left: 25%;
clear: both;
float: left;
font-size: 80px;
z-index: 500;
filter: alpha(opacity=75);
opacity: .75;
}
#menu ul{
text-decoration: none;
list-style-type: none;
margin: 0;
padding: 0;
line-height: 90px;
}
#menu ul li{
text-decoration: none;
list-style-type: none;
margin: 0;
}
#menu ul li a{
border-bottom: 6px solid #000;
text-decoration: none;
list-style-type: none;
color: #000;
}
#menu ul li a:hover{
}
Run Code Online (Sandbox Code Playgroud) 我已经看过这个 关于在android textview周围设置边框的主题,并且我使用了它.但现在,我想在小部件周围放置边框,这些小部件位于相对布局中.我该怎么做?
我创建了一个逻辑,用于裁剪包含在网格内部边框内的图像.网格有很多边框,所以这个网格会有很多图片.问题是,当我缩放图片时,逻辑会缩放图片(这没关系)但是当我使用裁剪逻辑时,它AdornerLayer会像图片一样走出边框:
在这张图片上,pic没有缩放,所以这AdornerLayer是正确的:
我用来将裁剪添加到图像的代码:
private void AddCropToElement(FrameworkElement fel, System.Drawing.Image img)
{
if (!cropElements.ContainsKey(Convert.ToString(((Image)fel).Source)))
{
if (_felCur != null)
{
RemoveCropFromCur();
}
rcInterior = new Rect(
fel.ActualWidth * 0.2,
fel.ActualHeight * 0.2,
fel.ActualWidth * 0.6,
fel.ActualHeight * 0.6);
rectMoving = false;
Rect newRect = scaleRect(rcInterior, img);
imgCropMove = img;
AdornerLayer aly = AdornerLayer.GetAdornerLayer(fel);
_clp = new CroppingAdorner(fel, rcInterior);
aly.Add(_clp);
cropElements.Add(Convert.ToString(((Image)fel).Source), fel);
imageCropped = _clp.Crop(new System.Drawing.Bitmap(img), newRect);
_clp.CropChanged += HandleCropChanged;
_felCur = fel;
}
}
Run Code Online (Sandbox Code Playgroud)
在这种情况下,名为fel的对象是我要裁剪的图片,而Border是他的父级.
如果图像被缩放,我如何解决AdornerLayout外出的问题?
我正在寻找一种方法,以编程方式为textview或按钮设置边框,而不使用setBackgroundResource方法.
我试图在这里实现的目标是,动态地改变背景颜色,但具有固定的边框.当我使用setBackgroundResource方法作为背景边框时,在以编程方式更改背景颜色后,边框不会保留.
我想删除 React Native 中标题底部的微弱边框。我正在使用useLayoutEffect()钩子修改标题,但无法删除边框。我尝试过使用borderBottomWidth: 0insideheaderStyle但它不起作用。
useLayoutEffect(() => {
navigation.setOptions({
title: "Signal",
headerStyle: { backgroundColor: "#fff", borderBottomWidth: 0 },
headerTitleStyle: { color: "#000" },
headerTintColor: "#000",
});
}, [navigation]);
Run Code Online (Sandbox Code Playgroud)
我的项目由两个类组成,GoBoard扩展了JPanel.
GoTest.java:
import javax.swing.*;
import java.awt.Graphics;
import java.io.*;
import java.awt.*;
import javax.swing.border.Border;
import javax.swing.border.LineBorder;
class GoTest{
private static void initGui(){
JFrame frame = new JFrame("GoBoard");
GoBoard jboard = new GoBoard();
jboard.setLayout(new BorderLayout(10,10));
jboard.setBorder(BorderFactory.createEmptyBorder(0,10,10,10));
frame.add(jboard);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(400, 400);
frame.pack();
frame.setVisible(true);
}
public static void main(String[] args){
javax.swing.SwingUtilities.invokeLater(new Runnable(){
public void run(){
initGui();
}
});
}
}
Run Code Online (Sandbox Code Playgroud)
GoBoard.java:
import javax.swing.*;
import java.awt.Graphics;
import javax.swing.border.Border;
class GoBoard extends JPanel{
private int linien;
public GoBoard(){
this(9);
}
public GoBoard(int pLinien){
this.linien = pLinien;
this.setBorder(BorderFactory.createEmptyBorder(0,10,10,10)); …Run Code Online (Sandbox Code Playgroud) 我想制作一个圆角的图像.图像将来自输入,我将使其圆角然后保存.我使用纯java.我怎样才能做到这一点?我需要一个像这样的功能
public void makeRoundedCorner(Image image, File outputFile){
.....
}
Run Code Online (Sandbox Code Playgroud)

编辑:添加了图像以供参考.
border ×10
android ×3
css ×3
java ×2
adornerlayer ×1
bitmap ×1
button ×1
c# ×1
crop ×1
css-shapes ×1
html ×1
image ×1
javascript ×1
jpanel ×1
margin ×1
react-hooks ×1
react-native ×1
swing ×1
text ×1
textview ×1
wpf ×1